lkml.org 
[lkml]   [2020]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] iio: chemical: Add OF match table for CCS811 VOC sensor
On Mon, Apr 13, 2020 at 11:23:03PM +0300, Andy Shevchenko wrote:
> On Mon, Apr 13, 2020 at 10:23 AM <mani@kernel.org> wrote:
> >
> > From: Manivannan Sadhasivam <mani@kernel.org>
> >
> > Add devicetree OF match table support for CCS811 VOC sensor.
>
> ...
>
> > +#include <linux/of.h>
>
> Why?
>

As replied to Jonathan, will drop this and of_match_ptr.

Thanks,
Mani

> ...
>
> > +static const struct of_device_id ccs811_dt_ids[] = {
> > + { .compatible = "ams,ccs811" },
> > + { }
> > +};
> > +MODULE_DEVICE_TABLE(of, ccs811_dt_ids);
>
> Since it has no ugly ifdeffery...
>
> > static struct i2c_driver ccs811_driver = {
> > .driver = {
> > .name = "ccs811",
> > + .of_match_table = of_match_ptr(ccs811_dt_ids),
>
> ...use of of_match_ptr() brings a compiler warning.
>
> Drop of_match_ptr() for good. And thus drop redundant of.h.
>
> > },
>
> --
> With Best Regards,
> Andy Shevchenko

\
 
 \ /
  Last update: 2020-04-14 13:54    [W:3.102 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site