From: Johan Hovold <johan@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: Frank Li <Frank.Li@nxp.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Heiko Stuebner <heiko@sntech.de>,
Laxman Dewangan <ldewangan@nvidia.com>,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Johan Hovold <johan@kernel.org>
Subject: [PATCH 4/5] spi: rockchip: fix controller deregistration
Date: Mon, 23 Mar 2026 11:49:47 +0100 [thread overview]
Message-ID: <20260323104948.844583-5-johan@kernel.org> (raw)
In-Reply-To: <20260323104948.844583-1-johan@kernel.org>
Make sure to deregister the controller before freeing underlying
resources like DMA channels during driver unbind.
Fixes: 64e36824b32b ("spi/rockchip: add driver for Rockchip RK3xxx SoCs integrated SPI")
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/spi/spi-rockchip.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index fd2ebef4903f..eb1992b4178e 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -908,7 +908,7 @@ static int rockchip_spi_probe(struct platform_device *pdev)
break;
}
- ret = devm_spi_register_controller(&pdev->dev, ctlr);
+ ret = spi_register_controller(ctlr);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to register controller\n");
goto err_free_dma_rx;
@@ -936,6 +936,8 @@ static void rockchip_spi_remove(struct platform_device *pdev)
pm_runtime_get_sync(&pdev->dev);
+ spi_unregister_controller(ctlr);
+
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
--
2.52.0
next prev parent reply other threads:[~2026-03-23 10:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 10:49 [PATCH 0/5] spi: imx: fix use-after-free on unbind Johan Hovold
2026-03-23 10:49 ` [PATCH 1/5] " Johan Hovold
2026-03-23 11:00 ` Marc Kleine-Budde
2026-03-23 11:20 ` Johan Hovold
2026-03-23 11:57 ` Marc Kleine-Budde
2026-03-23 13:59 ` Johan Hovold
2026-03-23 14:47 ` Marc Kleine-Budde
2026-03-23 15:41 ` Johan Hovold
2026-03-23 10:49 ` [PATCH 2/5] spi: imx: switch to managed controller allocation Johan Hovold
2026-03-23 10:49 ` [PATCH 3/5] spi: tegra20-slink: " Johan Hovold
2026-03-23 10:49 ` Johan Hovold [this message]
2026-03-23 16:35 ` [PATCH 4/5] spi: rockchip: fix controller deregistration Mark Brown
2026-03-23 16:51 ` Johan Hovold
2026-03-23 17:02 ` Mark Brown
2026-03-24 8:09 ` Johan Hovold
2026-03-23 10:49 ` [PATCH 5/5] spi: rockchip: switch to managed controller allocation Johan Hovold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260323104948.844583-5-johan@kernel.org \
--to=johan@kernel.org \
--cc=Frank.Li@nxp.com \
--cc=broonie@kernel.org \
--cc=heiko@sntech.de \
--cc=ldewangan@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.