diff mbox series

[v3,3/4] iio: adc: ad7923: Add of_device_id table

Message ID 20191217111158.30888-4-djunho@gmail.com (mailing list archive)
State New, archived
Headers show
Series Add support for the ad7908/ad7918/ad7928 | expand

Commit Message

Daniel Junho Dec. 17, 2019, 11:11 a.m. UTC
Accomplish device tree compatibility to driver AD7923
by adding of_device_id table and making a subsequent call to
MODULE_DEVICE_TABLE.

Signed-off-by: Daniel Junho <djunho@gmail.com>
---
 drivers/iio/adc/ad7923.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Alexandru Ardelean Dec. 17, 2019, 11:30 a.m. UTC | #1
On Tue, 2019-12-17 at 08:11 -0300, Daniel Junho wrote:
> Accomplish device tree compatibility to driver AD7923
> by adding of_device_id table and making a subsequent call to
> MODULE_DEVICE_TABLE.
> 

Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>

> Signed-off-by: Daniel Junho <djunho@gmail.com>
> ---
>  drivers/iio/adc/ad7923.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/iio/adc/ad7923.c b/drivers/iio/adc/ad7923.c
> index e535cec9fc02..6d56fa0b9e30 100644
> --- a/drivers/iio/adc/ad7923.c
> +++ b/drivers/iio/adc/ad7923.c
> @@ -348,9 +348,19 @@ static const struct spi_device_id ad7923_id[] = {
>  };
>  MODULE_DEVICE_TABLE(spi, ad7923_id);
>  
> +static const struct of_device_id ad7923_of_match[] = {
> +	{ .compatible = "adi,ad7904", },
> +	{ .compatible = "adi,ad7914", },
> +	{ .compatible = "adi,ad7923", },
> +	{ .compatible = "adi,ad7924", },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(of, ad7923_of_match);
> +
>  static struct spi_driver ad7923_driver = {
>  	.driver = {
>  		.name	= "ad7923",
> +		.of_match_table = ad7923_of_match,
>  	},
>  	.probe		= ad7923_probe,
>  	.remove		= ad7923_remove,
Jonathan Cameron Dec. 23, 2019, 3:36 p.m. UTC | #2
On Tue, 17 Dec 2019 11:30:56 +0000
"Ardelean, Alexandru" <alexandru.Ardelean@analog.com> wrote:

> On Tue, 2019-12-17 at 08:11 -0300, Daniel Junho wrote:
> > Accomplish device tree compatibility to driver AD7923
> > by adding of_device_id table and making a subsequent call to
> > MODULE_DEVICE_TABLE.
> >   
> 
> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan

> 
> > Signed-off-by: Daniel Junho <djunho@gmail.com>
> > ---
> >  drivers/iio/adc/ad7923.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/drivers/iio/adc/ad7923.c b/drivers/iio/adc/ad7923.c
> > index e535cec9fc02..6d56fa0b9e30 100644
> > --- a/drivers/iio/adc/ad7923.c
> > +++ b/drivers/iio/adc/ad7923.c
> > @@ -348,9 +348,19 @@ static const struct spi_device_id ad7923_id[] = {
> >  };
> >  MODULE_DEVICE_TABLE(spi, ad7923_id);
> >  
> > +static const struct of_device_id ad7923_of_match[] = {
> > +	{ .compatible = "adi,ad7904", },
> > +	{ .compatible = "adi,ad7914", },
> > +	{ .compatible = "adi,ad7923", },
> > +	{ .compatible = "adi,ad7924", },
> > +	{ },
> > +};
> > +MODULE_DEVICE_TABLE(of, ad7923_of_match);
> > +
> >  static struct spi_driver ad7923_driver = {
> >  	.driver = {
> >  		.name	= "ad7923",
> > +		.of_match_table = ad7923_of_match,
> >  	},
> >  	.probe		= ad7923_probe,
> >  	.remove		= ad7923_remove,
diff mbox series

Patch

diff --git a/drivers/iio/adc/ad7923.c b/drivers/iio/adc/ad7923.c
index e535cec9fc02..6d56fa0b9e30 100644
--- a/drivers/iio/adc/ad7923.c
+++ b/drivers/iio/adc/ad7923.c
@@ -348,9 +348,19 @@  static const struct spi_device_id ad7923_id[] = {
 };
 MODULE_DEVICE_TABLE(spi, ad7923_id);
 
+static const struct of_device_id ad7923_of_match[] = {
+	{ .compatible = "adi,ad7904", },
+	{ .compatible = "adi,ad7914", },
+	{ .compatible = "adi,ad7923", },
+	{ .compatible = "adi,ad7924", },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, ad7923_of_match);
+
 static struct spi_driver ad7923_driver = {
 	.driver = {
 		.name	= "ad7923",
+		.of_match_table = ad7923_of_match,
 	},
 	.probe		= ad7923_probe,
 	.remove		= ad7923_remove,