Skip to content

Commit 0245435

Browse files
jhovoldbroonie
authored andcommitted
spi: uniphier: fix controller deregistration
Make sure to deregister the controller before releasing underlying resources like DMA during driver unbind. Note that clocks were also disabled before the recent commit fdca270 ("spi: uniphier: Simplify clock handling with devm_clk_get_enabled()"). Fixes: 5ba155a ("spi: add SPI controller driver for UniPhier SoC") Cc: stable@vger.kernel.org # 4.19 Cc: Keiji Hayashibara <hayashibara.keiji@socionext.com> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20260410081757.503099-25-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 0c18a1b commit 0245435

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/spi/spi-uniphier.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ static int uniphier_spi_probe(struct platform_device *pdev)
746746

747747
host->max_dma_len = min(dma_tx_burst, dma_rx_burst);
748748

749-
ret = devm_spi_register_controller(&pdev->dev, host);
749+
ret = spi_register_controller(host);
750750
if (ret)
751751
goto out_release_dma;
752752

@@ -771,10 +771,16 @@ static void uniphier_spi_remove(struct platform_device *pdev)
771771
{
772772
struct spi_controller *host = platform_get_drvdata(pdev);
773773

774+
spi_controller_get(host);
775+
776+
spi_unregister_controller(host);
777+
774778
if (host->dma_tx)
775779
dma_release_channel(host->dma_tx);
776780
if (host->dma_rx)
777781
dma_release_channel(host->dma_rx);
782+
783+
spi_controller_put(host);
778784
}
779785

780786
static const struct of_device_id uniphier_spi_match[] = {

0 commit comments

Comments
 (0)