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

From: Vladimir Oltean
Date: Fri Sep 16 2022 - 18:40:19 EST


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.