Re: [PATCH v2 2/2] iio: (bma400) add driver for the BMA400

From: Jonathan Cameron
Date: Sat Oct 12 2019 - 05:31:36 EST


On Sat, 12 Oct 2019 10:39:54 +0300
Andy Shevchenko <andy.shevchenko@xxxxxxxxx> wrote:

> On Sat, Oct 12, 2019 at 10:07 AM Randy Dunlap <rdunlap@xxxxxxxxxxxxx> wrote:
> > On 10/11/19 8:54 PM, Dan Robertson wrote:
>
> > > +config BMA400_I2C
> > > + tristate
> > > + depends on BMA400
> > > + depends on I2C
> > > + select REGMAP_I2C
> > > +
> >
> > The bma400_i2c driver seems to use some OF interfaces.
> > Should it also depend on OF?
>
> Please, avoid unnecessary and strict dependencies when it's limiting
> the area of use the driver.
> The driver does not depend to OF. Why to stick with OF?
>
> The actual change has to be done is to switch from
>
> > #include <linux/of.h>
>
> to
>
> #include <linux/mod_devicetable.h>
>

Good point Andy. There are numerous drivers in IIO that do the same
over enthusiastic including of linux/of.h just to get of_device_id
definition. Would be good to clean those up to just include this
instead.

This is going to cause very little noise so if there are any new
contributors reading this it would be a nice sensible cleanup to get
started with!

Thanks,

Jonathan