power: regulator: Add more debugging and fix a missing newline
authorSimon Glass <sjg@chromium.org>
Wed, 31 May 2017 23:57:15 +0000 (17:57 -0600)
committerSimon Glass <sjg@chromium.org>
Fri, 9 Jun 2017 19:39:32 +0000 (13:39 -0600)
This file does not report a few possible errors and one message is missing
a newline. Fix these.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/power/regulator/regulator-uclass.c

index a42f80bb2b39cb4a5c25f5eca0c37b02e83e86f5..0a1d1b36c067c0334600ac6cf81c0ebf62cc8c9c 100644 (file)
@@ -146,8 +146,10 @@ int regulator_get_by_platname(const char *plat_name, struct udevice **devp)
 
        for (ret = uclass_find_first_device(UCLASS_REGULATOR, &dev); dev;
             ret = uclass_find_next_device(&dev)) {
-               if (ret)
+               if (ret) {
+                       debug("regulator %s, ret=%d\n", dev->name, ret);
                        continue;
+               }
 
                uc_pdata = dev_get_uclass_platdata(dev);
                if (!uc_pdata || strcmp(plat_name, uc_pdata->name))
@@ -156,7 +158,7 @@ int regulator_get_by_platname(const char *plat_name, struct udevice **devp)
                return uclass_get_device_tail(dev, 0, devp);
        }
 
-       debug("%s: can't find: %s\n", __func__, plat_name);
+       debug("%s: can't find: %s, ret=%d\n", __func__, plat_name, ret);
 
        return -ENODEV;
 }
@@ -219,7 +221,7 @@ int regulator_autoset_by_name(const char *platname, struct udevice **devp)
        if (devp)
                *devp = dev;
        if (ret) {
-               debug("Can get the regulator: %s!", platname);
+               debug("Can get the regulator: %s (err=%d)\n", platname, ret);
                return ret;
        }