diff mbox series

[23/23] iio:adc:ingenic: drop of_match_ptr protection and include mod_devicetable.h

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

Whilst it's unlikely this device will ever be instantiated using
ACPI, there is little advantage not assigning the of_device_id table in all
cases and it avoids providing an example that might be coppied into new
drivers.

Also include mod_devicetable.h whilst here as of_device_id is defined
in there so including the header is best practice.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Artur Rojek <contact@artur-rojek.eu>
---
 drivers/iio/adc/ingenic-adc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

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

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Whilst it's unlikely this device will ever be instantiated using
> ACPI, there is little advantage not assigning the of_device_id table in all
> cases and it avoids providing an example that might be coppied into new
> drivers.
> 
> Also include mod_devicetable.h whilst here as of_device_id is defined
> in there so including the header is best practice.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Artur Rojek <contact@artur-rojek.eu>
Applied thanks,

Jonathan

> ---
>  drivers/iio/adc/ingenic-adc.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/ingenic-adc.c b/drivers/iio/adc/ingenic-adc.c
> index 3ea097c9650e..fa7ae7f6677e 100644
> --- a/drivers/iio/adc/ingenic-adc.c
> +++ b/drivers/iio/adc/ingenic-adc.c
> @@ -13,6 +13,7 @@
>  #include <linux/iopoll.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/mutex.h>
>  #include <linux/platform_device.h>
>  
> @@ -497,7 +498,6 @@ static int ingenic_adc_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -#ifdef CONFIG_OF
>  static const struct of_device_id ingenic_adc_of_match[] = {
>  	{ .compatible = "ingenic,jz4725b-adc", .data = &jz4725b_adc_soc_data, },
>  	{ .compatible = "ingenic,jz4740-adc", .data = &jz4740_adc_soc_data, },
> @@ -505,12 +505,11 @@ static const struct of_device_id ingenic_adc_of_match[] = {
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(of, ingenic_adc_of_match);
> -#endif
>  
>  static struct platform_driver ingenic_adc_driver = {
>  	.driver = {
>  		.name = "ingenic-adc",
> -		.of_match_table = of_match_ptr(ingenic_adc_of_match),
> +		.of_match_table = ingenic_adc_of_match,
>  	},
>  	.probe = ingenic_adc_probe,
>  };
diff mbox series

Patch

diff --git a/drivers/iio/adc/ingenic-adc.c b/drivers/iio/adc/ingenic-adc.c
index 3ea097c9650e..fa7ae7f6677e 100644
--- a/drivers/iio/adc/ingenic-adc.c
+++ b/drivers/iio/adc/ingenic-adc.c
@@ -13,6 +13,7 @@ 
 #include <linux/iopoll.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/mutex.h>
 #include <linux/platform_device.h>
 
@@ -497,7 +498,6 @@  static int ingenic_adc_probe(struct platform_device *pdev)
 	return ret;
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id ingenic_adc_of_match[] = {
 	{ .compatible = "ingenic,jz4725b-adc", .data = &jz4725b_adc_soc_data, },
 	{ .compatible = "ingenic,jz4740-adc", .data = &jz4740_adc_soc_data, },
@@ -505,12 +505,11 @@  static const struct of_device_id ingenic_adc_of_match[] = {
 	{ },
 };
 MODULE_DEVICE_TABLE(of, ingenic_adc_of_match);
-#endif
 
 static struct platform_driver ingenic_adc_driver = {
 	.driver = {
 		.name = "ingenic-adc",
-		.of_match_table = of_match_ptr(ingenic_adc_of_match),
+		.of_match_table = ingenic_adc_of_match,
 	},
 	.probe = ingenic_adc_probe,
 };