mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
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 commitfdca270f8f("spi: uniphier: Simplify clock handling with devm_clk_get_enabled()"). Fixes:5ba155a4d4("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>
This commit is contained in:
parent
0c18a1bacb
commit
0245435f77
|
|
@ -746,7 +746,7 @@ static int uniphier_spi_probe(struct platform_device *pdev)
|
|||
|
||||
host->max_dma_len = min(dma_tx_burst, dma_rx_burst);
|
||||
|
||||
ret = devm_spi_register_controller(&pdev->dev, host);
|
||||
ret = spi_register_controller(host);
|
||||
if (ret)
|
||||
goto out_release_dma;
|
||||
|
||||
|
|
@ -771,10 +771,16 @@ static void uniphier_spi_remove(struct platform_device *pdev)
|
|||
{
|
||||
struct spi_controller *host = platform_get_drvdata(pdev);
|
||||
|
||||
spi_controller_get(host);
|
||||
|
||||
spi_unregister_controller(host);
|
||||
|
||||
if (host->dma_tx)
|
||||
dma_release_channel(host->dma_tx);
|
||||
if (host->dma_rx)
|
||||
dma_release_channel(host->dma_rx);
|
||||
|
||||
spi_controller_put(host);
|
||||
}
|
||||
|
||||
static const struct of_device_id uniphier_spi_match[] = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user