Skip to content

Commit 5f4a36a

Browse files
bardliaoranj063
authored andcommitted
soundwire: only handle alert events when the peripheral is attached
It doesn't make sense to handle an alert event when the peripheral is not attached. The slave->status could be SDW_SLAVE_ATTACHED or SDW_SLAVE_ALERT when it is attached on the bus. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent 111d1fb commit 5f4a36a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/soundwire/bus.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,6 +1958,10 @@ int sdw_handle_slave_status(struct sdw_bus *bus,
19581958
break;
19591959

19601960
case SDW_SLAVE_ALERT:
1961+
if (slave->status != SDW_SLAVE_ATTACHED &&
1962+
slave->status != SDW_SLAVE_ALERT)
1963+
continue;
1964+
19611965
ret = sdw_handle_slave_alerts(slave);
19621966
if (ret < 0)
19631967
dev_err(&slave->dev,

0 commit comments

Comments
 (0)