Skip to content

Commit

Permalink
spi: spi-fsl-qspi: use devm_spi_register_controller
Browse files Browse the repository at this point in the history
The driver does not clearly unregister the spi controller.
Therefore calling an unbind and bind again will end up in a
Kernel crash.

The function devm_spi_register_controller will automatically
be unregister the SPI device.

Signed-off-by: Volker Haspel <volker.haspel@linutronix.de>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Volker Haspel authored and Mark Brown committed Mar 13, 2019
1 parent 0a9c899 commit 8fcb830
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi-fsl-qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ static int fsl_qspi_probe(struct platform_device *pdev)

ctlr->dev.of_node = np;

ret = spi_register_controller(ctlr);
ret = devm_spi_register_controller(dev, ctlr);
if (ret)
goto err_destroy_mutex;

Expand Down

0 comments on commit 8fcb830

Please sign in to comment.