mirror of
https://github.com/LineageOS/android_kernel_fxtec_sm6115.git
synced 2026-08-18 12:31:09 +00:00
spi: lantiq-ssc: fix controller deregistration
[ Upstream commit b99206710d032c16b7f8b75e4bc18414d8e4b9f4 ]
Make sure to deregister the controller before releasing underlying
resources like clocks during driver unbind.
Fixes: 17f84b793c ("spi: lantiq-ssc: add support for Lantiq SSC SPI controller")
Cc: stable@vger.kernel.org # 4.11
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260409120419.388546-17-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
[ adapted spi_controller/host naming to spi_master/master and preserved the int-returning remove() with trailing return 0 ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ulrich Hecht <uli@kernel.org>
This commit is contained in:
committed by
Ulrich Hecht
parent
2972b4916b
commit
bca34c0e0c
@ -945,7 +945,7 @@ static int lantiq_ssc_probe(struct platform_device *pdev)
|
||||
"Lantiq SSC SPI controller (Rev %i, TXFS %u, RXFS %u, DMA %u)\n",
|
||||
revision, spi->tx_fifo_size, spi->rx_fifo_size, supports_dma);
|
||||
|
||||
err = devm_spi_register_master(dev, master);
|
||||
err = spi_register_master(master);
|
||||
if (err) {
|
||||
dev_err(dev, "failed to register spi_master\n");
|
||||
goto err_wq_destroy;
|
||||
@ -969,6 +969,10 @@ static int lantiq_ssc_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct lantiq_ssc_spi *spi = platform_get_drvdata(pdev);
|
||||
|
||||
spi_master_get(spi->master);
|
||||
|
||||
spi_unregister_master(spi->master);
|
||||
|
||||
lantiq_ssc_writel(spi, 0, LTQ_SPI_IRNEN);
|
||||
lantiq_ssc_writel(spi, 0, LTQ_SPI_CLC);
|
||||
rx_fifo_flush(spi);
|
||||
@ -979,6 +983,8 @@ static int lantiq_ssc_remove(struct platform_device *pdev)
|
||||
clk_disable_unprepare(spi->spi_clk);
|
||||
clk_put(spi->fpi_clk);
|
||||
|
||||
spi_master_put(spi->master);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user