diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2018-04-26 11:53:06 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-05-14 23:58:45 +0300 |
commit | 88a9769e609a7f3b762a2fe88555c5602758346b (patch) | |
tree | 2cc9aa01dcc7d92b325e58f8bce09bb694112f76 | |
parent | d21bc89eb98cac7a7af6476f41cbdf10f082dd6b (diff) | |
download | linux-88a9769e609a7f3b762a2fe88555c5602758346b.tar.xz |
driver core: Respect all error codes from dev_pm_domain_attach()
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/base/platform.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 8075ddc70a17..9460139d9b02 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -572,17 +572,16 @@ static int platform_drv_probe(struct device *_dev) return ret; ret = dev_pm_domain_attach(_dev, true); - if (ret != -EPROBE_DEFER) { - if (drv->probe) { - ret = drv->probe(dev); - if (ret) - dev_pm_domain_detach(_dev, true); - } else { - /* don't fail if just dev_pm_domain_attach failed */ - ret = 0; - } + if (ret) + goto out; + + if (drv->probe) { + ret = drv->probe(dev); + if (ret) + dev_pm_domain_detach(_dev, true); } +out: if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) { dev_warn(_dev, "probe deferral not supported\n"); ret = -ENXIO; |