[U-Boot] [PATCH v4] gpio: dwapb_gpio: Add reset ctrl to driver

Ley Foon Tan lftan.linux at gmail.com
Tue Sep 4 01:34:37 UTC 2018


On Thu, Aug 30, 2018 at 8:11 PM Marek Vasut <marex at denx.de> wrote:
>
> On 08/30/2018 02:45 AM, Ley Foon Tan wrote:
> > On Wed, Aug 29, 2018 at 7:57 PM Marek Vasut <marex at denx.de> wrote:
> >>
> >> 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 <ley.foon.tan at intel.com>
> >>
> >> 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 ?
> > By default, dev_warn() is not show up. Or we can move this dev_warn
> > when "return ret" error below.
>
> I think that'd be better. If there is no reset support, no point in
> warning. Or what do you think ?
>
> btw you could then also flatten the indent with some
> ret = reset....
> if (ret == -ENOENT || ....)
>  return 0;
>
> dev_warn();
> return ret;

Okay, will change this.

Regards
Ley Foon


More information about the U-Boot mailing list