diff mbox series

[06/23] iio:adc:max1027: drop of_match_ptr and CONFIG_OF protections

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

These just prevent the driver being used with ACPI PRP0001
and provide no major benefits.

Part of clearing these out in general in IIO to avoid cut and paste
repetition in new drivers.  Also include mod_devicetable.h as we
directly make use of of_device_id which is defined in there.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Philippe Reynes <tremyfr@yahoo.fr>
---
 drivers/iio/adc/max1027.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

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

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> These just prevent the driver being used with ACPI PRP0001
> and provide no major benefits.
> 
> Part of clearing these out in general in IIO to avoid cut and paste
> repetition in new drivers.  Also include mod_devicetable.h as we
> directly make use of of_device_id which is defined in there.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: Philippe Reynes <tremyfr@yahoo.fr>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to poke at it.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/max1027.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
> index 9e993ccd14de..ca1dff3924ff 100644
> --- a/drivers/iio/adc/max1027.c
> +++ b/drivers/iio/adc/max1027.c
> @@ -14,6 +14,7 @@
>  
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/spi/spi.h>
>  #include <linux/delay.h>
>  
> @@ -79,7 +80,6 @@ static const struct spi_device_id max1027_id[] = {
>  };
>  MODULE_DEVICE_TABLE(spi, max1027_id);
>  
> -#ifdef CONFIG_OF
>  static const struct of_device_id max1027_adc_dt_ids[] = {
>  	{ .compatible = "maxim,max1027" },
>  	{ .compatible = "maxim,max1029" },
> @@ -90,7 +90,6 @@ static const struct of_device_id max1027_adc_dt_ids[] = {
>  	{},
>  };
>  MODULE_DEVICE_TABLE(of, max1027_adc_dt_ids);
> -#endif
>  
>  #define MAX1027_V_CHAN(index, depth)					\
>  	{								\
> @@ -518,7 +517,7 @@ static int max1027_probe(struct spi_device *spi)
>  static struct spi_driver max1027_driver = {
>  	.driver = {
>  		.name	= "max1027",
> -		.of_match_table = of_match_ptr(max1027_adc_dt_ids),
> +		.of_match_table = max1027_adc_dt_ids,
>  	},
>  	.probe		= max1027_probe,
>  	.id_table	= max1027_id,
diff mbox series

Patch

diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
index 9e993ccd14de..ca1dff3924ff 100644
--- a/drivers/iio/adc/max1027.c
+++ b/drivers/iio/adc/max1027.c
@@ -14,6 +14,7 @@ 
 
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/spi/spi.h>
 #include <linux/delay.h>
 
@@ -79,7 +80,6 @@  static const struct spi_device_id max1027_id[] = {
 };
 MODULE_DEVICE_TABLE(spi, max1027_id);
 
-#ifdef CONFIG_OF
 static const struct of_device_id max1027_adc_dt_ids[] = {
 	{ .compatible = "maxim,max1027" },
 	{ .compatible = "maxim,max1029" },
@@ -90,7 +90,6 @@  static const struct of_device_id max1027_adc_dt_ids[] = {
 	{},
 };
 MODULE_DEVICE_TABLE(of, max1027_adc_dt_ids);
-#endif
 
 #define MAX1027_V_CHAN(index, depth)					\
 	{								\
@@ -518,7 +517,7 @@  static int max1027_probe(struct spi_device *spi)
 static struct spi_driver max1027_driver = {
 	.driver = {
 		.name	= "max1027",
-		.of_match_table = of_match_ptr(max1027_adc_dt_ids),
+		.of_match_table = max1027_adc_dt_ids,
 	},
 	.probe		= max1027_probe,
 	.id_table	= max1027_id,