Re: [PATCH v1 net-next 2/2] net: mscc: ocelot: check return values of writes during reset

From: Colin Foster
Date: Fri Sep 16 2022 - 19:12:25 EST


On Fri, Sep 16, 2022 at 10:40:10PM +0000, Vladimir Oltean wrote:
> On Fri, Sep 16, 2022 at 12:13:49PM -0700, Colin Foster wrote:
> > - regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_ENA], 1);
> > - regmap_field_write(ocelot->regfields[SYS_RESET_CFG_CORE_ENA], 1);
> > + err = regmap_field_write(ocelot->regfields[SYS_RESET_CFG_MEM_ENA], 1);
> > + if (err)
> > + return err;
> >
> > - return 0;
> > + err = regmap_field_write(ocelot->regfields[SYS_RESET_CFG_CORE_ENA], 1);
> > +
> > + return err;
> > }
>
> A kernel janitor will come and patch this up to:
>
> return regmap_field_write(ocelot->regfields[SYS_RESET_CFG_CORE_ENA], 1);
>
> so it's better to do it yourself.

Good catch. That and removing the IS_ERR_VALUE macro from patch 1 and
I'll resubmit after the weekend.