Re: [PATCH v2 2/2] iio: adc: Add a driver for the Ingenic X1600 ADC

From: Andy Shevchenko

Date: Sat Oct 24 2026 - 06:13:08 EST


On Sat, Oct 24, 2026 at 09:00:06AM +0200, Joshua Crofts wrote:
> On Sat, 24 Oct 2026 06:13:57 +0200
> Olivier Louvignes <olivier@xxxxxxxxx> wrote:

Olivier, I also missed the cover letter, can you make sure it's there in v3,
please?

...

> > + case IIO_CHAN_INFO_RAW:
> > + ret = x1600_adc_read_raw_channel(adc, chan->channel, val);
> > + return ret ? ret : IIO_VAL_INT;
>
> You can use the Elvis operator here.

While true, Jonathan preference to open code this type of cases

if (ret)
return ret;

return IIO_VAL_INT;

...

> > + /*
> > + * Powered up for good: the keys poll it every few tens of milliseconds,
> > + * and powering up takes 2 ms.
> > + */
> > + writel(0, adc->base + X1600_ADC_REG_ENABLE);
> > + fsleep(2000);

fsleep(2 * USEC_PER_MSEC);

(will require time.h to be included).

> > + writel(0, adc->base + X1600_ADC_REG_CTRL);

--
With Best Regards,
Andy Shevchenko