spi: zynq-qspi: Fix missing spi_unregister_controller when unload module
diff mbox series

Message ID 20190818095113.2397-1-axel.lin@ingics.com
State New
Headers show
Series
  • spi: zynq-qspi: Fix missing spi_unregister_controller when unload module
Related show

Commit Message

Axel Lin Aug. 18, 2019, 9:51 a.m. UTC
Use devm_spi_register_controller to fix missing spi_unregister_controller
when unload module.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/spi/spi-zynq-qspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michal Simek Aug. 19, 2019, 6:54 a.m. UTC | #1
On 18. 08. 19 11:51, Axel Lin wrote:
> Use devm_spi_register_controller to fix missing spi_unregister_controller
> when unload module.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  drivers/spi/spi-zynq-qspi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/spi-zynq-qspi.c b/drivers/spi/spi-zynq-qspi.c
> index 3155e2cabb1e..4a5326ccf65a 100644
> --- a/drivers/spi/spi-zynq-qspi.c
> +++ b/drivers/spi/spi-zynq-qspi.c
> @@ -694,7 +694,7 @@ static int zynq_qspi_probe(struct platform_device *pdev)
>  	ctlr->setup = zynq_qspi_setup_op;
>  	ctlr->max_speed_hz = clk_get_rate(xqspi->refclk) / 2;
>  	ctlr->dev.of_node = np;
> -	ret = spi_register_controller(ctlr);
> +	ret = devm_spi_register_controller(&pdev->dev, ctlr);
>  	if (ret) {
>  		dev_err(&pdev->dev, "spi_register_master failed\n");
>  		goto clk_dis_all;
> 

Acked-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal

Patch
diff mbox series

diff --git a/drivers/spi/spi-zynq-qspi.c b/drivers/spi/spi-zynq-qspi.c
index 3155e2cabb1e..4a5326ccf65a 100644
--- a/drivers/spi/spi-zynq-qspi.c
+++ b/drivers/spi/spi-zynq-qspi.c
@@ -694,7 +694,7 @@  static int zynq_qspi_probe(struct platform_device *pdev)
 	ctlr->setup = zynq_qspi_setup_op;
 	ctlr->max_speed_hz = clk_get_rate(xqspi->refclk) / 2;
 	ctlr->dev.of_node = np;
-	ret = spi_register_controller(ctlr);
+	ret = devm_spi_register_controller(&pdev->dev, ctlr);
 	if (ret) {
 		dev_err(&pdev->dev, "spi_register_master failed\n");
 		goto clk_dis_all;