mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
spi: sh-hspi: fix controller deregistration
Make sure to deregister the controller before releasing underlying
resources like clocks during driver unbind.
Fixes: 49e599b859 ("spi: sh-hspi: control spi clock more correctly")
Cc: stable@vger.kernel.org # 3.4
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260410081757.503099-13-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
c1446b61e4
commit
e63982e639
|
|
@ -257,9 +257,9 @@ static int hspi_probe(struct platform_device *pdev)
|
|||
ctlr->transfer_one_message = hspi_transfer_one_message;
|
||||
ctlr->bits_per_word_mask = SPI_BPW_MASK(8);
|
||||
|
||||
ret = devm_spi_register_controller(&pdev->dev, ctlr);
|
||||
ret = spi_register_controller(ctlr);
|
||||
if (ret < 0) {
|
||||
dev_err(&pdev->dev, "devm_spi_register_controller error.\n");
|
||||
dev_err(&pdev->dev, "failed to register controller\n");
|
||||
goto error2;
|
||||
}
|
||||
|
||||
|
|
@ -279,9 +279,15 @@ static void hspi_remove(struct platform_device *pdev)
|
|||
{
|
||||
struct hspi_priv *hspi = platform_get_drvdata(pdev);
|
||||
|
||||
spi_controller_get(hspi->ctlr);
|
||||
|
||||
spi_unregister_controller(hspi->ctlr);
|
||||
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
|
||||
clk_put(hspi->clk);
|
||||
|
||||
spi_controller_put(hspi->ctlr);
|
||||
}
|
||||
|
||||
static const struct of_device_id hspi_of_match[] = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user