]> git.baikalelectronics.ru Git - kernel.git/commit
soundwire: bus_type: fix remove and shutdown support
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 10 Jun 2022 01:51:05 +0000 (09:51 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:48 +0000 (14:23 +0200)
commitdc63662381c52f5c5fa83800c005c9cff7143adc
tree2ea3e9ec88b7ef621a39832da5e0e65075a01469
parente37c3c57f0a924f166b7b870ed3e655fdce6dafb
soundwire: bus_type: fix remove and shutdown support

[ Upstream commit 705af9a12fd79d6ab16c1b32a9477bd55ac3837c ]

The bus sdw_drv_remove() and sdw_drv_shutdown() helpers are used
conditionally, if the driver provides these routines.

These helpers already test if the driver provides a .remove or
.shutdown callback, so there's no harm in invoking the
sdw_drv_remove() and sdw_drv_shutdown() unconditionally.

In addition, the current code is imbalanced with
dev_pm_domain_attach() called from sdw_drv_probe(), but
dev_pm_domain_detach() called from sdw_drv_remove() only if the driver
provides a .remove callback.

Fixes: fe1a869bbae9c ("soundwire: Add SoundWire bus type")
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220610015105.25987-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soundwire/bus_type.c