[07/10] soundwire: bus: disable pm_runtime in sdw_slave_delete

Message ID 20200115000844.14695-8-pierre-louis.bossart@linux.intel.com
State New
Headers show
  • [01/10] soundwire: bus: fix race condition with probe_complete signaling
Related show

Commit Message

Pierre-Louis Bossart Jan. 15, 2020, 12:08 a.m.
Before removing the slave device, disable pm_runtime to prevent any
race condition with the resume being executed after the bus and slave
devices are removed.

Since this pm_runtime_disable() is handled in common routines,
implementations of Slave drivers do not need to call it in their
.remove() routine.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
 drivers/soundwire/bus.c | 2 ++
 1 file changed, 2 insertions(+)


diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
index 57dec61142e5..33bb273454cf 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -113,6 +113,8 @@  static int sdw_delete_slave(struct device *dev, void *data)
 	struct sdw_slave *slave = dev_to_sdw_dev(dev);
 	struct sdw_bus *bus = slave->bus;
+	pm_runtime_disable(dev);