soundwire: Respect all error codes from dev_pm_domain_attach()
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 26 Apr 2018 08:53:09 +0000 (10:53 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 14 May 2018 20:58:45 +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: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/soundwire/bus_type.c

index d5f3a70c06b059b9177c1b74dfe823d439caad28..283b2832728ee01e9047ffcc6756686f2bb8763c 100644 (file)
@@ -83,17 +83,16 @@ static int sdw_drv_probe(struct device *dev)
         * attach to power domain but don't turn on (last arg)
         */
        ret = dev_pm_domain_attach(dev, false);
-       if (ret != -EPROBE_DEFER) {
-               ret = drv->probe(slave, id);
-               if (ret) {
-                       dev_err(dev, "Probe of %s failed: %d\n", drv->name, ret);
-                       dev_pm_domain_detach(dev, false);
-               }
-       }
-
        if (ret)
                return ret;
 
+       ret = drv->probe(slave, id);
+       if (ret) {
+               dev_err(dev, "Probe of %s failed: %d\n", drv->name, ret);
+               dev_pm_domain_detach(dev, false);
+               return ret;
+       }
+
        /* device is probed so let's read the properties now */
        if (slave->ops && slave->ops->read_prop)
                slave->ops->read_prop(slave);