spi: Respect all error codes from dev_pm_domain_attach()
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 26 Apr 2018 08:53:10 +0000 (10:53 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 14 May 2018 20:58:46 +0000 (22:58 +0200)
The limitation of being able to check only for -EPROBE_DEFER from
dev_pm_domain_attach() has been removed. Hence let's respect all error
codes and bail out accordingly.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/spi/spi.c

index 7b213faa0a2b7247837372a4bc4a537e1c9a2ad1..eeab67f50580c256b72a994c674f7fbde50cd1dd 100644 (file)
@@ -356,11 +356,12 @@ static int spi_drv_probe(struct device *dev)
        }
 
        ret = dev_pm_domain_attach(dev, true);
-       if (ret != -EPROBE_DEFER) {
-               ret = sdrv->probe(spi);
-               if (ret)
-                       dev_pm_domain_detach(dev, true);
-       }
+       if (ret)
+               return ret;
+
+       ret = sdrv->probe(spi);
+       if (ret)
+               dev_pm_domain_detach(dev, true);
 
        return ret;
 }