From: Johan Hovold Date: Thu, 9 Apr 2026 12:04:06 +0000 (+0200) Subject: spi: bcmbca-hsspi: fix controller deregistration X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=c3d97c3320b9a1ebbd6119857341be034f7b3efc;p=thirdparty%2Fkernel%2Flinux.git spi: bcmbca-hsspi: fix controller deregistration Make sure to deregister the controller before disabling underlying resources like interrupts during driver unbind to allow SPI drivers to do I/O during deregistration. Note that clocks were also disabled before the recent commit e532e21a246d ("spi: bcm63xx-hsspi: Simplify clock handling with devm_clk_get_enabled()"). Fixes: a38a2233f23b ("spi: bcmbca-hsspi: Add driver for newer HSSPI controller") Cc: stable@vger.kernel.org # 6.3: deb269e0394f Cc: stable@vger.kernel.org # 6.3 Cc: William Zhang Signed-off-by: Johan Hovold Link: https://patch.msgid.link/20260409120419.388546-8-johan@kernel.org Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-bcmbca-hsspi.c b/drivers/spi/spi-bcmbca-hsspi.c index 2e22345115fd0..09c1472ae4fa1 100644 --- a/drivers/spi/spi-bcmbca-hsspi.c +++ b/drivers/spi/spi-bcmbca-hsspi.c @@ -538,7 +538,7 @@ static int bcmbca_hsspi_probe(struct platform_device *pdev) return dev_err_probe(dev, ret, "couldn't register sysfs group\n"); /* register and we are done */ - ret = devm_spi_register_controller(dev, host); + ret = spi_register_controller(host); if (ret) goto out_sysgroup_disable; @@ -556,6 +556,8 @@ static void bcmbca_hsspi_remove(struct platform_device *pdev) struct spi_controller *host = platform_get_drvdata(pdev); struct bcmbca_hsspi *bs = spi_controller_get_devdata(host); + spi_unregister_controller(host); + /* reset the hardware and block queue progress */ __raw_writel(0, bs->regs + HSSPI_INT_MASK_REG); sysfs_remove_group(&pdev->dev.kobj, &bcmbca_hsspi_group);