Unverified Commit 0245435f authored by Johan Hovold's avatar Johan Hovold Committed by Mark Brown
Browse files

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

Fixes: 5ba155a4 ("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: default avatarJohan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260410081757.503099-25-johan@kernel.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0c18a1ba
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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[] = {