diff mbox series

[04/15] iio: sx9310: Remove acpi and of table macros

Message ID 20200728091057.4.I33c50453845a8167969130d514af86e573b6ef31@changeid (mailing list archive)
State New, archived
Headers show
Series sx9310 iio driver updates | expand

Commit Message

Daniel Campello July 28, 2020, 3:12 p.m. UTC
Avoids unused warnings due to acpi/of table macros.

Signed-off-by: Daniel Campello <campello@chromium.org>
Reported-by: kbuild test robot <lkp@intel.com>
---

 drivers/iio/proximity/sx9310.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Andy Shevchenko July 28, 2020, 6:09 p.m. UTC | #1
On Tue, Jul 28, 2020 at 6:16 PM Daniel Campello <campello@chromium.org> wrote:
>
> Avoids unused warnings due to acpi/of table macros.
>

At the same time I would check if mod_devicetable.h is included.

> Signed-off-by: Daniel Campello <campello@chromium.org>
> Reported-by: kbuild test robot <lkp@intel.com>
Daniel Campello July 28, 2020, 8:47 p.m. UTC | #2
On Tue, Jul 28, 2020 at 12:09 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Tue, Jul 28, 2020 at 6:16 PM Daniel Campello <campello@chromium.org> wrote:
> >
> > Avoids unused warnings due to acpi/of table macros.
> >
>
> At the same time I would check if mod_devicetable.h is included.
I did the following and no error showed up:
#ifndef LINUX_MOD_DEVICETABLE_H
#error Missing include
#endif

>
> > Signed-off-by: Daniel Campello <campello@chromium.org>
> > Reported-by: kbuild test robot <lkp@intel.com>
>
>
> --
> With Best Regards,
> Andy Shevchenko

Regards,
Daniel Campello
Stephen Boyd July 28, 2020, 9:28 p.m. UTC | #3
Quoting Daniel Campello (2020-07-28 13:47:15)
> On Tue, Jul 28, 2020 at 12:09 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> >
> > On Tue, Jul 28, 2020 at 6:16 PM Daniel Campello <campello@chromium.org> wrote:
> > >
> > > Avoids unused warnings due to acpi/of table macros.
> > >
> >
> > At the same time I would check if mod_devicetable.h is included.
> I did the following and no error showed up:
> #ifndef LINUX_MOD_DEVICETABLE_H
> #error Missing include
> #endif

That's fine, but it's usually better to avoid implicit include
dependencies so that order of includes doesn't matter and so that if the
headers change outside of this driver this driver doesn't have to be
fixed to include something it needs like mod_devicetable.h
diff mbox series

Patch

diff --git a/drivers/iio/proximity/sx9310.c b/drivers/iio/proximity/sx9310.c
index 76b8bedebeef50..0fb88ad66f7342 100644
--- a/drivers/iio/proximity/sx9310.c
+++ b/drivers/iio/proximity/sx9310.c
@@ -16,7 +16,6 @@ 
 #include <linux/irq.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/of.h>
 #include <linux/pm.h>
 #include <linux/regmap.h>
 #include <linux/slab.h>
@@ -1051,8 +1050,8 @@  MODULE_DEVICE_TABLE(i2c, sx9310_id);
 static struct i2c_driver sx9310_driver = {
 	.driver = {
 		.name	= "sx9310",
-		.acpi_match_table = ACPI_PTR(sx9310_acpi_match),
-		.of_match_table = of_match_ptr(sx9310_of_match),
+		.acpi_match_table = sx9310_acpi_match,
+		.of_match_table = sx9310_of_match,
 		.pm = &sx9310_pm_ops,
 	},
 	.probe		= sx9310_probe,