Message ID | 20200419150206.43033-5-jic23@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | iio: light: clean out of_match_ptr and tidy headers | expand |
On Sun, 2020-04-19 at 16:02 +0100, jic23@kernel.org wrote: > From: Jonathan Cameron <Jonathan.Cameron@huawei.com> > > Also drops ifdef protections for CONFIG_OF. > > Enables probing via ACPI PRP0001 and removes an example that might be > cut and paste into new drivers. > Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > --- > drivers/iio/light/gp2ap020a00f.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/iio/light/gp2ap020a00f.c > b/drivers/iio/light/gp2ap020a00f.c > index 7fbbce0d4bc7..070d4cd0cf54 100644 > --- a/drivers/iio/light/gp2ap020a00f.c > +++ b/drivers/iio/light/gp2ap020a00f.c > @@ -38,8 +38,8 @@ > #include <linux/irq.h> > #include <linux/irq_work.h> > #include <linux/module.h> > +#include <linux/mod_devicetable.h> > #include <linux/mutex.h> > -#include <linux/of.h> > #include <linux/regmap.h> > #include <linux/regulator/consumer.h> > #include <linux/slab.h> > @@ -1617,18 +1617,16 @@ static const struct i2c_device_id gp2ap020a00f_id[] = > { > > MODULE_DEVICE_TABLE(i2c, gp2ap020a00f_id); > > -#ifdef CONFIG_OF > static const struct of_device_id gp2ap020a00f_of_match[] = { > { .compatible = "sharp,gp2ap020a00f" }, > { } > }; > MODULE_DEVICE_TABLE(of, gp2ap020a00f_of_match); > -#endif > > static struct i2c_driver gp2ap020a00f_driver = { > .driver = { > .name = GP2A_I2C_NAME, > - .of_match_table = of_match_ptr(gp2ap020a00f_of_match), > + .of_match_table = gp2ap020a00f_of_match, > }, > .probe = gp2ap020a00f_probe, > .remove = gp2ap020a00f_remove,
diff --git a/drivers/iio/light/gp2ap020a00f.c b/drivers/iio/light/gp2ap020a00f.c index 7fbbce0d4bc7..070d4cd0cf54 100644 --- a/drivers/iio/light/gp2ap020a00f.c +++ b/drivers/iio/light/gp2ap020a00f.c @@ -38,8 +38,8 @@ #include <linux/irq.h> #include <linux/irq_work.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/mutex.h> -#include <linux/of.h> #include <linux/regmap.h> #include <linux/regulator/consumer.h> #include <linux/slab.h> @@ -1617,18 +1617,16 @@ static const struct i2c_device_id gp2ap020a00f_id[] = { MODULE_DEVICE_TABLE(i2c, gp2ap020a00f_id); -#ifdef CONFIG_OF static const struct of_device_id gp2ap020a00f_of_match[] = { { .compatible = "sharp,gp2ap020a00f" }, { } }; MODULE_DEVICE_TABLE(of, gp2ap020a00f_of_match); -#endif static struct i2c_driver gp2ap020a00f_driver = { .driver = { .name = GP2A_I2C_NAME, - .of_match_table = of_match_ptr(gp2ap020a00f_of_match), + .of_match_table = gp2ap020a00f_of_match, }, .probe = gp2ap020a00f_probe, .remove = gp2ap020a00f_remove,