From: Mark Brown Date: Wed, 4 Nov 2015 11:19:36 +0000 (+0000) Subject: Merge remote-tracking branch 'regulator/topic/list' into regulator-next X-Git-Tag: v4.9.8~3276^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5408dd8f0969ba6c0cfc1a167ca522205e939f06;p=platform%2Fkernel%2Flinux-rpi3.git Merge remote-tracking branch 'regulator/topic/list' into regulator-next --- 5408dd8f0969ba6c0cfc1a167ca522205e939f06 diff --cc drivers/regulator/core.c index 455732c,57a5deb..e9b94d7 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@@ -1394,21 -1439,18 +1439,22 @@@ static int regulator_resolve_supply(str return 0; r = regulator_dev_lookup(dev, rdev->supply_name, &ret); - if (ret == -ENODEV) { - /* - * No supply was specified for this regulator and - * there will never be one. - */ - return 0; - } - if (!r) { + if (ret == -ENODEV) { + /* + * No supply was specified for this regulator and + * there will never be one. + */ + return 0; + } + + /* Did the lookup explicitly defer for us? */ + if (ret == -EPROBE_DEFER) + return ret; + if (have_full_constraints()) { r = dummy_regulator_rdev; + get_device(&r->dev); } else { dev_err(dev, "Failed to resolve %s-supply for %s\n", rdev->supply_name, rdev->desc->name); @@@ -1418,18 -1460,23 +1464,22 @@@ /* Recursively resolve the supply of the supply */ ret = regulator_resolve_supply(r); - if (ret < 0) + if (ret < 0) { + put_device(&r->dev); return ret; + } ret = set_supply(rdev, r); - if (ret < 0) + if (ret < 0) { + put_device(&r->dev); return ret; + } /* Cascade always-on state to supply */ - if (_regulator_is_enabled(rdev)) { + if (_regulator_is_enabled(rdev) && rdev->supply) { ret = regulator_enable(rdev->supply); if (ret < 0) { - if (rdev->supply) - _regulator_put(rdev->supply); + _regulator_put(rdev->supply); return ret; } }