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

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

Fixes: 2a22f1b30cee ("spi: npcm: add NPCM PSPI controller driver")
Cc: stable@vger.kernel.org # 5.0
Cc: Tomer Maimon <tmaimon77@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260410081757.503099-5-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Johan Hovold and committed by
Mark Brown
ebd81199 8b0d0011

+7 -1
+7 -1
drivers/spi/spi-npcm-pspi.c
··· 413 413 /* set to default clock rate */ 414 414 npcm_pspi_set_baudrate(priv, NPCM_PSPI_DEFAULT_CLK); 415 415 416 - ret = devm_spi_register_controller(&pdev->dev, host); 416 + ret = spi_register_controller(host); 417 417 if (ret) 418 418 goto out_disable_clk; 419 419 ··· 434 434 struct spi_controller *host = platform_get_drvdata(pdev); 435 435 struct npcm_pspi *priv = spi_controller_get_devdata(host); 436 436 437 + spi_controller_get(host); 438 + 439 + spi_unregister_controller(host); 440 + 437 441 npcm_pspi_reset_hw(priv); 438 442 clk_disable_unprepare(priv->clk); 443 + 444 + spi_controller_put(host); 439 445 } 440 446 441 447 static const struct of_device_id npcm_pspi_match[] = {