linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: iio: adis16203: Add of_device_id table
@ 2019-05-18 22:42 Thiago Estrela
  2019-05-19 10:42 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Thiago Estrela @ 2019-05-18 22:42 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Stefan Popa,
	Jonathan Cameron, Hartmut Knaack, Peter Meerwald-Stadler,
	Greg Kroah-Hartman
  Cc: linux-iio, devel, linux-kernel, Thiago Estrela, Tiago Napoli,
	Pedro Sousa

Accomplish device tree compatibility to driver ADIS16203
by adding of_device_id table and making a subsequent call to
MODULE_DEVICE_TABLE.

Signed-off-by: Thiago Estrela <thiagestrela@gmail.com>
Signed-off-by: Tiago Napoli <napoli.tiago96@gmail.com>
Co-developed-by: Tiago Napoli <napoli.tiago96@gmail.com>
Signed-off-by: Pedro Sousa <pedroteosousa@gmail.com>
Co-developed-by: Pedro Sousa <pedroteosousa@gmail.com>
Reviewed-by: Matheus Tavares <matheus.bernardino@usp.br>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
---
 drivers/staging/iio/accel/adis16203.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c
index 70381756a64a..a5d974ac2e3b 100644
--- a/drivers/staging/iio/accel/adis16203.c
+++ b/drivers/staging/iio/accel/adis16203.c
@@ -311,9 +311,17 @@ static int adis16203_remove(struct spi_device *spi)
 	return 0;
 }
 
+static const struct of_device_id adis16203_of_match[] = {
+	{ .compatible = "adi,adis16203" },
+	{ },
+};
+
+MODULE_DEVICE_TABLE(of, adis16203_of_match);
+
 static struct spi_driver adis16203_driver = {
 	.driver = {
 		.name = "adis16203",
+		.of_match_table = adis16203_of_match,
 	},
 	.probe = adis16203_probe,
 	.remove = adis16203_remove,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: iio: adis16203: Add of_device_id table
  2019-05-18 22:42 [PATCH] staging: iio: adis16203: Add of_device_id table Thiago Estrela
@ 2019-05-19 10:42 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2019-05-19 10:42 UTC (permalink / raw)
  To: Thiago Estrela
  Cc: Lars-Peter Clausen, Michael Hennerich, Stefan Popa,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	linux-iio, devel, linux-kernel, Tiago Napoli, Pedro Sousa

On Sat, 18 May 2019 19:42:13 -0300
Thiago Estrela <thiagestrela@gmail.com> wrote:

> Accomplish device tree compatibility to driver ADIS16203
> by adding of_device_id table and making a subsequent call to
> MODULE_DEVICE_TABLE.
> 
> Signed-off-by: Thiago Estrela <thiagestrela@gmail.com>
> Signed-off-by: Tiago Napoli <napoli.tiago96@gmail.com>
> Co-developed-by: Tiago Napoli <napoli.tiago96@gmail.com>
> Signed-off-by: Pedro Sousa <pedroteosousa@gmail.com>
> Co-developed-by: Pedro Sousa <pedroteosousa@gmail.com>
> Reviewed-by: Matheus Tavares <matheus.bernardino@usp.br>
> Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Another nice patch.  Certainly seems like the dev day was
successful and welcome to so many new people.

Applied to the togreg branch of iio.git and pushed out as
testing for the autobuilders to see if we missed anything.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/accel/adis16203.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/staging/iio/accel/adis16203.c b/drivers/staging/iio/accel/adis16203.c
> index 70381756a64a..a5d974ac2e3b 100644
> --- a/drivers/staging/iio/accel/adis16203.c
> +++ b/drivers/staging/iio/accel/adis16203.c
> @@ -311,9 +311,17 @@ static int adis16203_remove(struct spi_device *spi)
>  	return 0;
>  }
>  
> +static const struct of_device_id adis16203_of_match[] = {
> +	{ .compatible = "adi,adis16203" },
> +	{ },
> +};
> +
> +MODULE_DEVICE_TABLE(of, adis16203_of_match);
> +
>  static struct spi_driver adis16203_driver = {
>  	.driver = {
>  		.name = "adis16203",
> +		.of_match_table = adis16203_of_match,
>  	},
>  	.probe = adis16203_probe,
>  	.remove = adis16203_remove,


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-19 17:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-18 22:42 [PATCH] staging: iio: adis16203: Add of_device_id table Thiago Estrela
2019-05-19 10:42 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).