On 09/16/2016 01:33 AM, Marcel Ziswiler wrote:
According to the binding documentation the fixed regulator enable GPIO
is optional. However so far registration thereof failed if no enable
GPIO was specified. Fix this by making it entirely optional whether an
enable GPIO is used.

diff --git a/drivers/power/regulator/fixed.c b/drivers/power/regulator/fixed.c

@@ -37,11 +39,14 @@ static int fixed_regulator_ofdata_to_platdata(struct 
udevice *dev)
        /* Set type to fixed */
        uc_pdata->type = REGULATOR_TYPE_FIXED;

-       /* Get fixed regulator gpio desc */
+       /* Get fixed regulator optional enable GPIO desc */
        gpio = &dev_pdata->gpio;
        ret = gpio_request_by_name(dev, "gpio", 0, gpio, GPIOD_IS_OUT);
-       if (ret)
-               debug("Fixed regulator gpio - not found! Error: %d", ret);
+       if (ret) {
+               debug("Fixed regulator optional enable GPIO: %d\n", ret);
+               if (ret != -ENOENT)
+                       return ret;

That message doesn't exactly make it obvious that it's describing a "not found" condition. Still, it is a debug() statement, so presumably anyone seeing the issue can just look at the code to see what's going on and work it out easily enough. So, aside from the DEBUG setting you already meantioned,

Acked-by: Stephen Warren <swar...@nvidia.com>
U-Boot mailing list

Reply via email to