spi: Merge up old fix
authorMark Brown <broonie@kernel.org>
Tue, 19 Sep 2023 12:03:10 +0000 (13:03 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 19 Sep 2023 12:17:52 +0000 (13:17 +0100)
This fix was originally queued at the end of the 6.4 cycle but as it was
minor it never actually got sent.

1  2 
drivers/spi/spi-zynqmp-gqspi.c

index 94d9a33d9af56e8c76bf7b14937d97bec190a3a9,c309dedfd6020becd59f0499dd24952b2200c743..9a46b2478f4e98bd38c794b17fa7a2bdae4e36f4
@@@ -14,7 -14,9 +14,7 @@@
  #include <linux/interrupt.h>
  #include <linux/io.h>
  #include <linux/module.h>
 -#include <linux/of_irq.h>
 -#include <linux/of_address.h>
 -#include <linux/of_device.h>
 +#include <linux/of.h>
  #include <linux/platform_device.h>
  #include <linux/pm_runtime.h>
  #include <linux/spi/spi.h>
@@@ -1293,8 -1295,8 +1293,8 @@@ static int zynqmp_qspi_probe(struct pla
        zynqmp_qspi_init_hw(xqspi);
  
        xqspi->irq = platform_get_irq(pdev, 0);
 -      if (xqspi->irq <= 0) {
 -              ret = -ENXIO;
 +      if (xqspi->irq < 0) {
 +              ret = xqspi->irq;
                goto clk_dis_all;
        }
        ret = devm_request_irq(&pdev->dev, xqspi->irq, zynqmp_qspi_irq,
        return 0;
  
  clk_dis_all:
-       pm_runtime_put_sync(&pdev->dev);
-       pm_runtime_set_suspended(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
+       pm_runtime_put_noidle(&pdev->dev);
+       pm_runtime_set_suspended(&pdev->dev);
        clk_disable_unprepare(xqspi->refclk);
  clk_dis_pclk:
        clk_disable_unprepare(xqspi->pclk);
@@@ -1366,11 -1368,15 +1366,15 @@@ static void zynqmp_qspi_remove(struct p
  {
        struct zynqmp_qspi *xqspi = platform_get_drvdata(pdev);
  
+       pm_runtime_get_sync(&pdev->dev);
        zynqmp_gqspi_write(xqspi, GQSPI_EN_OFST, 0x0);
+       pm_runtime_disable(&pdev->dev);
+       pm_runtime_put_noidle(&pdev->dev);
+       pm_runtime_set_suspended(&pdev->dev);
        clk_disable_unprepare(xqspi->refclk);
        clk_disable_unprepare(xqspi->pclk);
-       pm_runtime_set_suspended(&pdev->dev);
-       pm_runtime_disable(&pdev->dev);
  }
  
  MODULE_DEVICE_TABLE(of, zynqmp_qspi_of_match);