Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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
fdca270f8f87 ("spi: uniphier: Simplify clock handling with
devm_clk_get_enabled()").

Fixes: 5ba155a4d4cc ("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>

authored by

Johan Hovold and committed by
Mark Brown
0245435f 0c18a1ba

+7 -1
+7 -1
drivers/spi/spi-uniphier.c
··· 746 746 747 747 host->max_dma_len = min(dma_tx_burst, dma_rx_burst); 748 748 749 - ret = devm_spi_register_controller(&pdev->dev, host); 749 + ret = spi_register_controller(host); 750 750 if (ret) 751 751 goto out_release_dma; 752 752 ··· 771 771 { 772 772 struct spi_controller *host = platform_get_drvdata(pdev); 773 773 774 + spi_controller_get(host); 775 + 776 + spi_unregister_controller(host); 777 + 774 778 if (host->dma_tx) 775 779 dma_release_channel(host->dma_tx); 776 780 if (host->dma_rx) 777 781 dma_release_channel(host->dma_rx); 782 + 783 + spi_controller_put(host); 778 784 } 779 785 780 786 static const struct of_device_id uniphier_spi_match[] = {