Re: [PATCH 2/3] iio: proximity: add driver for ST VL53L1X ToF sensor
From: Jonathan Cameron
Date: Sun Mar 08 2026 - 14:07:54 EST
> > > + */
> > > +
> > > +#include <linux/bits.h>
> > > +#include <linux/delay.h>
> > > +#include <linux/gpio/consumer.h>
> > > +#include <linux/i2c.h>
> > > +#include <linux/irq.h>
> > > +#include <linux/interrupt.h>
> > > +#include <linux/module.h>
> > > +#include <linux/regmap.h>
> > > +#include <linux/regulator/consumer.h>
> >
> > Check that you have includes for all things used directly in this
> > driver. For example dev_err()
> >
> > We use a slightly relaxed version of include what you use for IIO
> > (and the kernel in general). So sometimes there are headers that
> > are well documented as including others, but when that's not true
> > we don't make assumptions and so include everything relevant even
> > if it happens to be included via another path today.
> >
> I've added linux/device.h, linux/bitfield.h, linux/completion.h, and
> linux/mod_devicetable.h. Hopefully this covers everything. For dev_err(),
> I was conflicted between linux/dev_printk.h and linux/device.h, but
> ended up using the latter.
Preference there is for the lesser header, so would be linux/dev_printk.h
There are two big headers like this that we are trying to reduce includes
of, kernel.h and device.h
For device.h more or less only need it in drivers if you are actually
directly dereferencing something in struct device.
Thanks,
Jonathan