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>
This commit is contained in:
parent
d21bc89eb9
commit
88a9769e60
@ -572,17 +572,16 @@ static int platform_drv_probe(struct device *_dev)
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = dev_pm_domain_attach(_dev, true);
|
ret = dev_pm_domain_attach(_dev, true);
|
||||||
if (ret != -EPROBE_DEFER) {
|
if (ret)
|
||||||
|
goto out;
|
||||||
|
|
||||||
if (drv->probe) {
|
if (drv->probe) {
|
||||||
ret = drv->probe(dev);
|
ret = drv->probe(dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
dev_pm_domain_detach(_dev, true);
|
dev_pm_domain_detach(_dev, true);
|
||||||
} else {
|
|
||||||
/* don't fail if just dev_pm_domain_attach failed */
|
|
||||||
ret = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) {
|
if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) {
|
||||||
dev_warn(_dev, "probe deferral not supported\n");
|
dev_warn(_dev, "probe deferral not supported\n");
|
||||||
ret = -ENXIO;
|
ret = -ENXIO;
|
||||||
|
Loading…
Reference in New Issue
Block a user