diff mbox series

[07/23] iio:adc:ltc2496: Drop of_match_ptr and use mod_devicetable.h

Message ID 20200628123654.32830-8-jic23@kernel.org (mailing list archive)
State New, archived
Headers show
Series iio:adc more of_match_ptr and similar removal | expand

Commit Message

Jonathan Cameron June 28, 2020, 12:36 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

The macro prevents use of driver with ACPI PRP0001 and
the of_match_id structure is defined in mod_devicetable.h so include
that directly rather than of.h.

Note this is mostly about removing something I don't want cut and
paste into new drivers rather than expectation that this particular
driver will be used on an ACPI platform.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/iio/adc/ltc2496.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Uwe Kleine-König June 28, 2020, 3:52 p.m. UTC | #1
Hallo Jonathan,

On Sun, Jun 28, 2020 at 01:36:38PM +0100, Jonathan Cameron wrote:
> @@ -96,7 +96,7 @@ MODULE_DEVICE_TABLE(of, ltc2496_of_match);
>  static struct spi_driver ltc2496_driver = {
>  	.driver = {
>  		.name = "ltc2496",
> -		.of_match_table = of_match_ptr(ltc2496_of_match),
> +		.of_match_table = ltc2496_of_match,

The usage of of_match_ptr would only make sense here if ltc2496_of_match
was defined conditionally. As this isn't the case:

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Thanks
Uwe
Jonathan Cameron July 4, 2020, 4:58 p.m. UTC | #2
On Sun, 28 Jun 2020 17:52:21 +0200
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:

> Hallo Jonathan,
> 
> On Sun, Jun 28, 2020 at 01:36:38PM +0100, Jonathan Cameron wrote:
> > @@ -96,7 +96,7 @@ MODULE_DEVICE_TABLE(of, ltc2496_of_match);
> >  static struct spi_driver ltc2496_driver = {
> >  	.driver = {
> >  		.name = "ltc2496",
> > -		.of_match_table = of_match_ptr(ltc2496_of_match),
> > +		.of_match_table = ltc2496_of_match,  
> 
> The usage of of_match_ptr would only make sense here if ltc2496_of_match
> was defined conditionally. As this isn't the case:
> 
> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thanks, 

Applied to the togreg branch of iio.git and pushed out as testing to
see if we missed anything.

Thanks,

Jonathan

> 
> Thanks
> Uwe
>
diff mbox series

Patch

diff --git a/drivers/iio/adc/ltc2496.c b/drivers/iio/adc/ltc2496.c
index 88a30156a849..dd956a7c216e 100644
--- a/drivers/iio/adc/ltc2496.c
+++ b/drivers/iio/adc/ltc2496.c
@@ -14,7 +14,7 @@ 
 #include <linux/iio/iio.h>
 #include <linux/iio/driver.h>
 #include <linux/module.h>
-#include <linux/of.h>
+#include <linux/mod_devicetable.h>
 
 #include "ltc2497.h"
 
@@ -96,7 +96,7 @@  MODULE_DEVICE_TABLE(of, ltc2496_of_match);
 static struct spi_driver ltc2496_driver = {
 	.driver = {
 		.name = "ltc2496",
-		.of_match_table = of_match_ptr(ltc2496_of_match),
+		.of_match_table = ltc2496_of_match,
 	},
 	.probe = ltc2496_probe,
 	.remove = ltc2496_remove,