diff mbox series

[21/23] iio:adc:ti-tlc4541: Drop CONFIG_OF and of_match_ptr protections.

Message ID 20200628123654.32830-22-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 stop us using ACPI PRP0001 to instantiate the device.
I am slowly clearly out use of these in IIO to avoid this being coppied
into new drivers.

Here I also included mod_devicetable.h as we are using of_match_id
which is defined in there and hence it is best practice to include
it directly.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Phil Reid <preid@electromag.com.au>
---
 drivers/iio/adc/ti-tlc4541.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Phil Reid June 28, 2020, 11:43 p.m. UTC | #1
On 28/06/2020 20:36, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> These stop us using ACPI PRP0001 to instantiate the device.
> I am slowly clearly out use of these in IIO to avoid this being coppied
> into new drivers.
> 
> Here I also included mod_devicetable.h as we are using of_match_id
> which is defined in there and hence it is best practice to include
> it directly.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Phil Reid <preid@electromag.com.au>

Reviewed-by: Phil Reid <preid@electromag.com.au>

> ---
>   drivers/iio/adc/ti-tlc4541.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/ti-tlc4541.c b/drivers/iio/adc/ti-tlc4541.c
> index 432238246519..53359a2e5bea 100644
> --- a/drivers/iio/adc/ti-tlc4541.c
> +++ b/drivers/iio/adc/ti-tlc4541.c
> @@ -24,6 +24,7 @@
>   #include <linux/iio/triggered_buffer.h>
>   #include <linux/kernel.h>
>   #include <linux/module.h>
> +#include <linux/mod_devicetable.h>
>   #include <linux/regulator/consumer.h>
>   #include <linux/slab.h>
>   #include <linux/spi/spi.h>
> @@ -235,14 +236,12 @@ static int tlc4541_remove(struct spi_device *spi)
>   	return 0;
>   }
>   
> -#ifdef CONFIG_OF
>   static const struct of_device_id tlc4541_dt_ids[] = {
>   	{ .compatible = "ti,tlc3541", },
>   	{ .compatible = "ti,tlc4541", },
>   	{}
>   };
>   MODULE_DEVICE_TABLE(of, tlc4541_dt_ids);
> -#endif
>   
>   static const struct spi_device_id tlc4541_id[] = {
>   	{"tlc3541", TLC3541},
> @@ -254,7 +253,7 @@ MODULE_DEVICE_TABLE(spi, tlc4541_id);
>   static struct spi_driver tlc4541_driver = {
>   	.driver = {
>   		.name   = "tlc4541",
> -		.of_match_table = of_match_ptr(tlc4541_dt_ids),
> +		.of_match_table = tlc4541_dt_ids,
>   	},
>   	.probe          = tlc4541_probe,
>   	.remove         = tlc4541_remove,
>
Jonathan Cameron July 4, 2020, 5:32 p.m. UTC | #2
On Mon, 29 Jun 2020 07:43:55 +0800
Phil Reid <preid@electromag.com.au> wrote:

> On 28/06/2020 20:36, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > 
> > These stop us using ACPI PRP0001 to instantiate the device.
> > I am slowly clearly out use of these in IIO to avoid this being coppied
> > into new drivers.
> > 
> > Here I also included mod_devicetable.h as we are using of_match_id
> > which is defined in there and hence it is best practice to include
> > it directly.
> > 
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Phil Reid <preid@electromag.com.au>  
> 
> Reviewed-by: Phil Reid <preid@electromag.com.au>

Applied,

Thanks,

Jonathan

> 
> > ---
> >   drivers/iio/adc/ti-tlc4541.c | 5 ++---
> >   1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/iio/adc/ti-tlc4541.c b/drivers/iio/adc/ti-tlc4541.c
> > index 432238246519..53359a2e5bea 100644
> > --- a/drivers/iio/adc/ti-tlc4541.c
> > +++ b/drivers/iio/adc/ti-tlc4541.c
> > @@ -24,6 +24,7 @@
> >   #include <linux/iio/triggered_buffer.h>
> >   #include <linux/kernel.h>
> >   #include <linux/module.h>
> > +#include <linux/mod_devicetable.h>
> >   #include <linux/regulator/consumer.h>
> >   #include <linux/slab.h>
> >   #include <linux/spi/spi.h>
> > @@ -235,14 +236,12 @@ static int tlc4541_remove(struct spi_device *spi)
> >   	return 0;
> >   }
> >   
> > -#ifdef CONFIG_OF
> >   static const struct of_device_id tlc4541_dt_ids[] = {
> >   	{ .compatible = "ti,tlc3541", },
> >   	{ .compatible = "ti,tlc4541", },
> >   	{}
> >   };
> >   MODULE_DEVICE_TABLE(of, tlc4541_dt_ids);
> > -#endif
> >   
> >   static const struct spi_device_id tlc4541_id[] = {
> >   	{"tlc3541", TLC3541},
> > @@ -254,7 +253,7 @@ MODULE_DEVICE_TABLE(spi, tlc4541_id);
> >   static struct spi_driver tlc4541_driver = {
> >   	.driver = {
> >   		.name   = "tlc4541",
> > -		.of_match_table = of_match_ptr(tlc4541_dt_ids),
> > +		.of_match_table = tlc4541_dt_ids,
> >   	},
> >   	.probe          = tlc4541_probe,
> >   	.remove         = tlc4541_remove,
> >   
>
diff mbox series

Patch

diff --git a/drivers/iio/adc/ti-tlc4541.c b/drivers/iio/adc/ti-tlc4541.c
index 432238246519..53359a2e5bea 100644
--- a/drivers/iio/adc/ti-tlc4541.c
+++ b/drivers/iio/adc/ti-tlc4541.c
@@ -24,6 +24,7 @@ 
 #include <linux/iio/triggered_buffer.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/regulator/consumer.h>
 #include <linux/slab.h>
 #include <linux/spi/spi.h>
@@ -235,14 +236,12 @@  static int tlc4541_remove(struct spi_device *spi)
 	return 0;
 }
 
-#ifdef CONFIG_OF
 static const struct of_device_id tlc4541_dt_ids[] = {
 	{ .compatible = "ti,tlc3541", },
 	{ .compatible = "ti,tlc4541", },
 	{}
 };
 MODULE_DEVICE_TABLE(of, tlc4541_dt_ids);
-#endif
 
 static const struct spi_device_id tlc4541_id[] = {
 	{"tlc3541", TLC3541},
@@ -254,7 +253,7 @@  MODULE_DEVICE_TABLE(spi, tlc4541_id);
 static struct spi_driver tlc4541_driver = {
 	.driver = {
 		.name   = "tlc4541",
-		.of_match_table = of_match_ptr(tlc4541_dt_ids),
+		.of_match_table = tlc4541_dt_ids,
 	},
 	.probe          = tlc4541_probe,
 	.remove         = tlc4541_remove,