Merge remote-tracking branch 'regulator/fix/core' into regulator-linus
authorMark Brown <broonie@kernel.org>
Mon, 21 Sep 2015 21:15:58 +0000 (14:15 -0700)
committerMark Brown <broonie@kernel.org>
Mon, 21 Sep 2015 21:15:58 +0000 (14:15 -0700)
1  2 
drivers/regulator/core.c

diff --combined drivers/regulator/core.c
@@@ -1262,7 -1262,7 +1262,7 @@@ static struct regulator *create_regulat
        regulator->debugfs = debugfs_create_dir(regulator->supply_name,
                                                rdev->debugfs);
        if (!regulator->debugfs) {
 -              rdev_warn(rdev, "Failed to create debugfs directory\n");
 +              rdev_dbg(rdev, "Failed to create debugfs directory\n");
        } else {
                debugfs_create_u32("uA_load", 0444, regulator->debugfs,
                                   &regulator->uA_load);
@@@ -1394,15 -1394,15 +1394,15 @@@ 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;
+               }
                if (have_full_constraints()) {
                        r = dummy_regulator_rdev;
                } else {
                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;
                }
        }