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: sifive: fix controller deregistration

Make sure to deregister the controller before disabling underlying
resources like interrupts during driver unbind.

Note that clocks were also disabled before the recent commit
140039c23aca ("spi: sifive: Simplify clock handling with
devm_clk_get_enabled()").

Fixes: 484a9a68d669 ("spi: sifive: Add driver for the SiFive SPI controller")
Cc: stable@vger.kernel.org # 5.1
Cc: Yash Shah <yash.shah@sifive.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260410081757.503099-15-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Johan Hovold and committed by
Mark Brown
0f252366 45170f67

+7 -1
+7 -1
drivers/spi/spi-sifive.c
··· 392 392 dev_info(&pdev->dev, "mapped; irq=%d, cs=%d\n", 393 393 irq, host->num_chipselect); 394 394 395 - ret = devm_spi_register_controller(&pdev->dev, host); 395 + ret = spi_register_controller(host); 396 396 if (ret < 0) { 397 397 dev_err(&pdev->dev, "spi_register_host failed\n"); 398 398 goto put_host; ··· 411 411 struct spi_controller *host = platform_get_drvdata(pdev); 412 412 struct sifive_spi *spi = spi_controller_get_devdata(host); 413 413 414 + spi_controller_get(host); 415 + 416 + spi_unregister_controller(host); 417 + 414 418 /* Disable all the interrupts just in case */ 415 419 sifive_spi_write(spi, SIFIVE_SPI_REG_IE, 0); 420 + 421 + spi_controller_put(host); 416 422 } 417 423 418 424 static int sifive_spi_suspend(struct device *dev)