diff mbox series

[13/23] iio:adc:mcp3422: remove CONFIG_OF and of_match_ptr protections

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

They stop the driver being used with ACPI PRP0001 and are something
I want to avoid being cut and paste into new drivers.
Also switch the include from of.h to mod_devicetable.h as we
struct of_device_id is defined in there and we don't use anything
actually in of.h.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
 drivers/iio/adc/mcp3422.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

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

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> They stop the driver being used with ACPI PRP0001 and are something
> I want to avoid being cut and paste into new drivers.
> Also switch the include from of.h to mod_devicetable.h as we
> struct of_device_id is defined in there and we don't use anything
> actually in of.h.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Applied.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/mcp3422.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/adc/mcp3422.c b/drivers/iio/adc/mcp3422.c
> index 40e0d3ed05a5..ec9c79199ffb 100644
> --- a/drivers/iio/adc/mcp3422.c
> +++ b/drivers/iio/adc/mcp3422.c
> @@ -16,9 +16,9 @@
>  #include <linux/err.h>
>  #include <linux/i2c.h>
>  #include <linux/module.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/delay.h>
>  #include <linux/sysfs.h>
> -#include <linux/of.h>
>  #include <asm/unaligned.h>
>  
>  #include <linux/iio/iio.h>
> @@ -402,18 +402,16 @@ static const struct i2c_device_id mcp3422_id[] = {
>  };
>  MODULE_DEVICE_TABLE(i2c, mcp3422_id);
>  
> -#ifdef CONFIG_OF
>  static const struct of_device_id mcp3422_of_match[] = {
>  	{ .compatible = "mcp3422" },
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, mcp3422_of_match);
> -#endif
>  
>  static struct i2c_driver mcp3422_driver = {
>  	.driver = {
>  		.name = "mcp3422",
> -		.of_match_table = of_match_ptr(mcp3422_of_match),
> +		.of_match_table = mcp3422_of_match,
>  	},
>  	.probe = mcp3422_probe,
>  	.id_table = mcp3422_id,
diff mbox series

Patch

diff --git a/drivers/iio/adc/mcp3422.c b/drivers/iio/adc/mcp3422.c
index 40e0d3ed05a5..ec9c79199ffb 100644
--- a/drivers/iio/adc/mcp3422.c
+++ b/drivers/iio/adc/mcp3422.c
@@ -16,9 +16,9 @@ 
 #include <linux/err.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/delay.h>
 #include <linux/sysfs.h>
-#include <linux/of.h>
 #include <asm/unaligned.h>
 
 #include <linux/iio/iio.h>
@@ -402,18 +402,16 @@  static const struct i2c_device_id mcp3422_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, mcp3422_id);
 
-#ifdef CONFIG_OF
 static const struct of_device_id mcp3422_of_match[] = {
 	{ .compatible = "mcp3422" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, mcp3422_of_match);
-#endif
 
 static struct i2c_driver mcp3422_driver = {
 	.driver = {
 		.name = "mcp3422",
-		.of_match_table = of_match_ptr(mcp3422_of_match),
+		.of_match_table = mcp3422_of_match,
 	},
 	.probe = mcp3422_probe,
 	.id_table = mcp3422_id,