diff mbox series

[16/23] iio:adc:ti-adc0832: drop CONFIG_OF and of_match_ptr protections

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

I am also trying to remove these from IIO in general to avoid
them being coppied into new drivers.

Also include the mod_devicetable.h header as we are using
of_device_id which is defined in there.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
---
 drivers/iio/adc/ti-adc0832.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

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

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> These just prevent the driver being used with ACPI PRP0001.
> 
> I am also trying to remove these from IIO in general to avoid
> them being coppied into new drivers.
> 
> Also include the mod_devicetable.h header as we are using
> of_device_id which is defined in there.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Akinobu Mita <akinobu.mita@gmail.com>
Applied thanks

J
> ---
>  drivers/iio/adc/ti-adc0832.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/adc/ti-adc0832.c b/drivers/iio/adc/ti-adc0832.c
> index 3eb3ba5fb610..05061dc05b32 100644
> --- a/drivers/iio/adc/ti-adc0832.c
> +++ b/drivers/iio/adc/ti-adc0832.c
> @@ -8,6 +8,7 @@
>   */
>  
>  #include <linux/module.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/spi/spi.h>
>  #include <linux/iio/iio.h>
>  #include <linux/regulator/consumer.h>
> @@ -313,8 +314,6 @@ static int adc0832_remove(struct spi_device *spi)
>  	return 0;
>  }
>  
> -#ifdef CONFIG_OF
> -
>  static const struct of_device_id adc0832_dt_ids[] = {
>  	{ .compatible = "ti,adc0831", },
>  	{ .compatible = "ti,adc0832", },
> @@ -324,8 +323,6 @@ static const struct of_device_id adc0832_dt_ids[] = {
>  };
>  MODULE_DEVICE_TABLE(of, adc0832_dt_ids);
>  
> -#endif
> -
>  static const struct spi_device_id adc0832_id[] = {
>  	{ "adc0831", adc0831 },
>  	{ "adc0832", adc0832 },
> @@ -338,7 +335,7 @@ MODULE_DEVICE_TABLE(spi, adc0832_id);
>  static struct spi_driver adc0832_driver = {
>  	.driver = {
>  		.name = "adc0832",
> -		.of_match_table = of_match_ptr(adc0832_dt_ids),
> +		.of_match_table = adc0832_dt_ids,
>  	},
>  	.probe = adc0832_probe,
>  	.remove = adc0832_remove,
diff mbox series

Patch

diff --git a/drivers/iio/adc/ti-adc0832.c b/drivers/iio/adc/ti-adc0832.c
index 3eb3ba5fb610..05061dc05b32 100644
--- a/drivers/iio/adc/ti-adc0832.c
+++ b/drivers/iio/adc/ti-adc0832.c
@@ -8,6 +8,7 @@ 
  */
 
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/spi/spi.h>
 #include <linux/iio/iio.h>
 #include <linux/regulator/consumer.h>
@@ -313,8 +314,6 @@  static int adc0832_remove(struct spi_device *spi)
 	return 0;
 }
 
-#ifdef CONFIG_OF
-
 static const struct of_device_id adc0832_dt_ids[] = {
 	{ .compatible = "ti,adc0831", },
 	{ .compatible = "ti,adc0832", },
@@ -324,8 +323,6 @@  static const struct of_device_id adc0832_dt_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, adc0832_dt_ids);
 
-#endif
-
 static const struct spi_device_id adc0832_id[] = {
 	{ "adc0831", adc0831 },
 	{ "adc0832", adc0832 },
@@ -338,7 +335,7 @@  MODULE_DEVICE_TABLE(spi, adc0832_id);
 static struct spi_driver adc0832_driver = {
 	.driver = {
 		.name = "adc0832",
-		.of_match_table = of_match_ptr(adc0832_dt_ids),
+		.of_match_table = adc0832_dt_ids,
 	},
 	.probe = adc0832_probe,
 	.remove = adc0832_remove,