diff mbox series

[03/38] iio:potentiometer:max5432: Drop of_match_ptr and use generic fw accessors

Message ID 20200910173242.621168-4-jic23@kernel.org (mailing list archive)
State New
Headers show
Series iio: remaining easy of_match_ptr removal and related. | expand

Commit Message

Jonathan Cameron Sept. 10, 2020, 5:32 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

These prevent use of this driver with ACPI via PRP0001 and are
an example of an anti pattern I'm trying to remove from IIO.
Drop them to remove this restriction.

Also switch headers to reflect this change.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Martin Kaiser <martin@kaiser.cx>
---
 drivers/iio/potentiometer/max5432.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Martin Kaiser Sept. 21, 2020, 2:24 p.m. UTC | #1
Thus wrote Jonathan Cameron (jic23@kernel.org):

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> These prevent use of this driver with ACPI via PRP0001 and are
> an example of an anti pattern I'm trying to remove from IIO.
> Drop them to remove this restriction.

> Also switch headers to reflect this change.

> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Martin Kaiser <martin@kaiser.cx>
> ---
>  drivers/iio/potentiometer/max5432.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

> diff --git a/drivers/iio/potentiometer/max5432.c b/drivers/iio/potentiometer/max5432.c
> index 280de9c54471..aed3b6ab82a2 100644
> --- a/drivers/iio/potentiometer/max5432.c
> +++ b/drivers/iio/potentiometer/max5432.c
> @@ -11,8 +11,8 @@
>  #include <linux/iio/iio.h>
>  #include <linux/limits.h>
>  #include <linux/module.h>
> -#include <linux/of.h>
> -#include <linux/of_device.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/property.h>

>  /* All chip variants have 32 wiper positions. */
>  #define MAX5432_MAX_POS 31
> @@ -100,7 +100,7 @@ static int max5432_probe(struct i2c_client *client,

>  	data = iio_priv(indio_dev);
>  	data->client = client;
> -	data->ohm = (unsigned long)of_device_get_match_data(dev);
> +	data->ohm = (unsigned long)device_get_match_data(dev);

>  	indio_dev->info = &max5432_info;
>  	indio_dev->channels = max5432_channels;
> @@ -122,7 +122,7 @@ MODULE_DEVICE_TABLE(of, max5432_dt_ids);
>  static struct i2c_driver max5432_driver = {
>  	.driver = {
>  		.name = "max5432",
> -		.of_match_table = of_match_ptr(max5432_dt_ids),
> +		.of_match_table = max5432_dt_ids,
>  	},
>  	.probe = max5432_probe,
>  };
> -- 
> 2.28.0

Looks good to me.

Reviewed-by: Martin Kaiser <martin@kaiser.cx>
diff mbox series

Patch

diff --git a/drivers/iio/potentiometer/max5432.c b/drivers/iio/potentiometer/max5432.c
index 280de9c54471..aed3b6ab82a2 100644
--- a/drivers/iio/potentiometer/max5432.c
+++ b/drivers/iio/potentiometer/max5432.c
@@ -11,8 +11,8 @@ 
 #include <linux/iio/iio.h>
 #include <linux/limits.h>
 #include <linux/module.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
 
 /* All chip variants have 32 wiper positions. */
 #define MAX5432_MAX_POS 31
@@ -100,7 +100,7 @@  static int max5432_probe(struct i2c_client *client,
 
 	data = iio_priv(indio_dev);
 	data->client = client;
-	data->ohm = (unsigned long)of_device_get_match_data(dev);
+	data->ohm = (unsigned long)device_get_match_data(dev);
 
 	indio_dev->info = &max5432_info;
 	indio_dev->channels = max5432_channels;
@@ -122,7 +122,7 @@  MODULE_DEVICE_TABLE(of, max5432_dt_ids);
 static struct i2c_driver max5432_driver = {
 	.driver = {
 		.name = "max5432",
-		.of_match_table = of_match_ptr(max5432_dt_ids),
+		.of_match_table = max5432_dt_ids,
 	},
 	.probe = max5432_probe,
 };