Re: [PATCH v7 2/2] iio: adc: add support for Nuvoton NCT7201
From: Jonathan Cameron
Date: Sat Apr 26 2025 - 10:18:01 EST
>
> > + /* Enable Channel */
> > + if (chip->num_vin_channels <= 8) {
> > + err = regmap_write(chip->regmap, NCT7201_REG_CHANNEL_ENABLE,
> > + GENMASK(chip->num_vin_channels - 1, 0));
>
> > + if (err)
> > + return dev_err_probe(dev, err, "Failed to enable channel\n");
>
> This...
>
> > + } else {
> > + err = regmap_bulk_write(chip->regmap, NCT7201_REG_CHANNEL_ENABLE,
> > + &data, sizeof(data));
>
> > + if (err)
> > + return dev_err_probe(dev2, err, "Failed to enable channel\n");
>
> ...and this are identical, deduplicate by moving outside of if-else.
>
Not worth the dev vs dev2 distinction. They are ultimately the same device so
just use dev for both.
> > + }
>
>