diff mbox series

[05/23] iio:adc:max1363: Drop of_match_ptr and use generic device_get_match_data

Message ID 20200628123654.32830-6-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>

Allows driver to use ACPI PRP0001 binding and there was no particular
advantage in having the protections in this driver.

Mostly this part of an effort to remove as many OF specific bits
of handling from IIO and use the generic forms where possible.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 drivers/iio/adc/max1363.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

Comments

Jonathan Cameron July 4, 2020, 4:54 p.m. UTC | #1
On Sun, 28 Jun 2020 13:36:36 +0100
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Allows driver to use ACPI PRP0001 binding and there was no particular
> advantage in having the protections in this driver.
> 
> Mostly this part of an effort to remove as many OF specific bits
> of handling from IIO and use the generic forms where possible.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Applied.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/max1363.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c
> index d8da5da74b77..420e2ec154fc 100644
> --- a/drivers/iio/adc/max1363.c
> +++ b/drivers/iio/adc/max1363.c
> @@ -22,8 +22,8 @@
>  #include <linux/slab.h>
>  #include <linux/err.h>
>  #include <linux/module.h>
> -#include <linux/of.h>
> -#include <linux/of_device.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/property.h>
>  
>  #include <linux/iio/iio.h>
>  #include <linux/iio/sysfs.h>
> @@ -1529,8 +1529,6 @@ static irqreturn_t max1363_trigger_handler(int irq, void *p)
>  	return IRQ_HANDLED;
>  }
>  
> -#ifdef CONFIG_OF
> -
>  #define MAX1363_COMPATIBLE(of_compatible, cfg) {		\
>  			.compatible = of_compatible,		\
>  			.data = &max1363_chip_info_tbl[cfg],	\
> @@ -1578,7 +1576,6 @@ static const struct of_device_id max1363_of_match[] = {
>  	{ /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, max1363_of_match);
> -#endif
>  
>  static int max1363_probe(struct i2c_client *client,
>  			 const struct i2c_device_id *id)
> @@ -1613,7 +1610,7 @@ static int max1363_probe(struct i2c_client *client,
>  	/* this is only used for device removal purposes */
>  	i2c_set_clientdata(client, indio_dev);
>  
> -	st->chip_info = of_device_get_match_data(&client->dev);
> +	st->chip_info = device_get_match_data(&client->dev);
>  	if (!st->chip_info)
>  		st->chip_info = &max1363_chip_info_tbl[id->driver_data];
>  	st->client = client;
> @@ -1756,7 +1753,7 @@ MODULE_DEVICE_TABLE(i2c, max1363_id);
>  static struct i2c_driver max1363_driver = {
>  	.driver = {
>  		.name = "max1363",
> -		.of_match_table = of_match_ptr(max1363_of_match),
> +		.of_match_table = max1363_of_match,
>  	},
>  	.probe = max1363_probe,
>  	.remove = max1363_remove,
diff mbox series

Patch

diff --git a/drivers/iio/adc/max1363.c b/drivers/iio/adc/max1363.c
index d8da5da74b77..420e2ec154fc 100644
--- a/drivers/iio/adc/max1363.c
+++ b/drivers/iio/adc/max1363.c
@@ -22,8 +22,8 @@ 
 #include <linux/slab.h>
 #include <linux/err.h>
 #include <linux/module.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
 
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
@@ -1529,8 +1529,6 @@  static irqreturn_t max1363_trigger_handler(int irq, void *p)
 	return IRQ_HANDLED;
 }
 
-#ifdef CONFIG_OF
-
 #define MAX1363_COMPATIBLE(of_compatible, cfg) {		\
 			.compatible = of_compatible,		\
 			.data = &max1363_chip_info_tbl[cfg],	\
@@ -1578,7 +1576,6 @@  static const struct of_device_id max1363_of_match[] = {
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, max1363_of_match);
-#endif
 
 static int max1363_probe(struct i2c_client *client,
 			 const struct i2c_device_id *id)
@@ -1613,7 +1610,7 @@  static int max1363_probe(struct i2c_client *client,
 	/* this is only used for device removal purposes */
 	i2c_set_clientdata(client, indio_dev);
 
-	st->chip_info = of_device_get_match_data(&client->dev);
+	st->chip_info = device_get_match_data(&client->dev);
 	if (!st->chip_info)
 		st->chip_info = &max1363_chip_info_tbl[id->driver_data];
 	st->client = client;
@@ -1756,7 +1753,7 @@  MODULE_DEVICE_TABLE(i2c, max1363_id);
 static struct i2c_driver max1363_driver = {
 	.driver = {
 		.name = "max1363",
-		.of_match_table = of_match_ptr(max1363_of_match),
+		.of_match_table = max1363_of_match,
 	},
 	.probe = max1363_probe,
 	.remove = max1363_remove,