Skip to content

Commit f86b6c8

Browse files
jhovoldgregkh
authored andcommitted
spi: uniphier: fix controller deregistration
[ Upstream commit 0245435 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9eaf6dc commit f86b6c8

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
@@ -747,7 +747,7 @@ static int uniphier_spi_probe(struct platform_device *pdev)
747747

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

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

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

775+
spi_controller_get(host);
776+
777+
spi_unregister_controller(host);
778+
775779
if (host->dma_tx)
776780
dma_release_channel(host->dma_tx);
777781
if (host->dma_rx)
778782
dma_release_channel(host->dma_rx);
783+
784+
spi_controller_put(host);
779785
}
780786

781787
static const struct of_device_id uniphier_spi_match[] = {

0 commit comments

Comments
 (0)