Skip to content

Commit 21a316f

Browse files
jhovoldgregkh
authored andcommitted
spi: rockchip: fix controller deregistration
commit 53e7a16 upstream. Make sure to deregister the controller before freeing underlying resources like DMA channels during driver unbind. Fixes: 64e3682 ("spi/rockchip: add driver for Rockchip RK3xxx SoCs integrated SPI") Cc: stable@vger.kernel.org # 3.17 Cc: addy ke <addy.ke@rock-chips.com> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20260324082326.901043-3-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8c4339d commit 21a316f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/spi/spi-rockchip.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ static int rockchip_spi_probe(struct platform_device *pdev)
909909
break;
910910
}
911911

912-
ret = devm_spi_register_controller(&pdev->dev, ctlr);
912+
ret = spi_register_controller(ctlr);
913913
if (ret < 0) {
914914
dev_err(&pdev->dev, "Failed to register controller\n");
915915
goto err_free_dma_rx;
@@ -937,6 +937,8 @@ static void rockchip_spi_remove(struct platform_device *pdev)
937937

938938
pm_runtime_get_sync(&pdev->dev);
939939

940+
spi_unregister_controller(ctlr);
941+
940942
pm_runtime_put_noidle(&pdev->dev);
941943
pm_runtime_disable(&pdev->dev);
942944
pm_runtime_set_suspended(&pdev->dev);

0 commit comments

Comments
 (0)