Skip to content

Commit

Permalink
soundwire: Respect all error codes from dev_pm_domain_attach()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Vinod Koul <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
storulf authored and rafaeljw committed May 14, 2018
1 parent d23fc02 commit 29ffcc8
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions drivers/soundwire/bus_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 29ffcc8

Please sign in to comment.