On 08/29/2018 10:44 AM, Ley Foon Tan wrote:
> Add code to reset all reset signals as in gpio DT node. A reset property
> is an optional feature, so only print out a warning and do not fail if a
> reset property is not present.
> 
> If a reset property is discovered, then use it to deassert, thus
> bringing the IP out of reset.
> 
> Signed-off-by: Ley Foon Tan <[email protected]>

This is much better.

> +static int gpio_dwapb_reset(struct udevice *dev)
> +{
> +     int ret;
> +     struct gpio_dwapb_priv *priv = dev_get_priv(dev);
> +
> +     ret = reset_get_bulk(dev, &priv->resets);
> +     if (ret) {
> +             dev_warn(dev, "Can't get reset: %d\n", ret);

Won't this barf on machines which either don't have DM_RESET enabled or
don't have it described in DT ?

> +             /* Return 0 if error due to !CONFIG_DM_RESET and reset
> +              * DT property is not present.
> +              */
> +             if (ret == -ENOENT || ret == -ENOTSUPP)
> +                     return 0;
> +             else
> +                     return ret;
> +     }
[...]

-- 
Best regards,
Marek Vasut
_______________________________________________
U-Boot mailing list
[email protected]
https://lists.denx.de/listinfo/u-boot

Reply via email to