Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: fsl-espi: fix controller deregistration

Make sure to deregister the controller before disabling runtime PM
(which can leave the controller disabled) to allow SPI device drivers to
do I/O during deregistration.

Fixes: e9abb4db8d10 ("spi: fsl-espi: add runtime PM")
Cc: stable@vger.kernel.org # 4.3
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260409120419.388546-14-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Johan Hovold and committed by
Mark Brown
e506a700 f4838934

+9 -1
+9 -1
drivers/spi/spi-fsl-espi.c
··· 718 718 pm_runtime_enable(dev); 719 719 pm_runtime_get_sync(dev); 720 720 721 - ret = devm_spi_register_controller(dev, host); 721 + ret = spi_register_controller(host); 722 722 if (ret < 0) 723 723 goto err_pm; 724 724 ··· 782 782 783 783 static void of_fsl_espi_remove(struct platform_device *dev) 784 784 { 785 + struct spi_controller *host = platform_get_drvdata(dev); 786 + 787 + spi_controller_get(host); 788 + 789 + spi_unregister_controller(host); 790 + 785 791 pm_runtime_disable(&dev->dev); 792 + 793 + spi_controller_put(host); 786 794 } 787 795 788 796 #ifdef CONFIG_PM_SLEEP