Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1713260 > unrolled thread

[PATCH v3 2/5] iio: srf08: add device tree table

Started byAndreas Klinger <ak@it-klinger.de>
First post2017-08-16 21:40 +0200
Last post2017-08-18 09:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v3 2/5] iio: srf08: add device tree table Andreas Klinger <ak@it-klinger.de> - 2017-08-16 21:40 +0200
    Re: [PATCH v3 2/5] iio: srf08: add device tree table Jonathan Cameron <jic23@kernel.org> - 2017-08-18 09:10 +0200

#1713260 — [PATCH v3 2/5] iio: srf08: add device tree table

FromAndreas Klinger <ak@it-klinger.de>
Date2017-08-16 21:40 +0200
Subject[PATCH v3 2/5] iio: srf08: add device tree table
Message-ID<ufcky-2IV-9@gated-at.bofh.it>
Added MODULE_DEVICE_TABLE for device tree bindings.

It used to work without it by using the i2c_device_id table, but adding the
table makes everything clear and documented.

Signed-off-by: Andreas Klinger <ak@it-klinger.de>
---
 drivers/iio/proximity/srf08.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/iio/proximity/srf08.c b/drivers/iio/proximity/srf08.c
index 49316cbf7c60..3f19536f215f 100644
--- a/drivers/iio/proximity/srf08.c
+++ b/drivers/iio/proximity/srf08.c
@@ -378,6 +378,13 @@ static int srf08_probe(struct i2c_client *client,
 	return devm_iio_device_register(&client->dev, indio_dev);
 }
 
+static const struct of_device_id of_srf08_match[] = {
+	{ .compatible = "devantech,srf08", 0},
+	{},
+};
+
+MODULE_DEVICE_TABLE(of, of_srf08_match);
+
 static const struct i2c_device_id srf08_id[] = {
 	{ "srf08", 0 },
 	{ }
@@ -387,6 +394,7 @@ MODULE_DEVICE_TABLE(i2c, srf08_id);
 static struct i2c_driver srf08_driver = {
 	.driver = {
 		.name	= "srf08",
+		.of_match_table	= of_srf08_match,
 	},
 	.probe = srf08_probe,
 	.id_table = srf08_id,
-- 
2.1.4


-- 

[toc] | [next] | [standalone]


#1714622

FromJonathan Cameron <jic23@kernel.org>
Date2017-08-18 09:10 +0200
Message-ID<ufJzQ-8rW-17@gated-at.bofh.it>
In reply to#1713260
On Wed, 16 Aug 2017 21:33:47 +0200
Andreas Klinger <ak@it-klinger.de> wrote:

> Added MODULE_DEVICE_TABLE for device tree bindings.
> 
> It used to work without it by using the i2c_device_id table, but adding the
> table makes everything clear and documented.
> 
> Signed-off-by: Andreas Klinger <ak@it-klinger.de>
Applied to the togreg branch of iio.git and pushed out as testing.

Thanks,

Jonathan
> ---
>  drivers/iio/proximity/srf08.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/iio/proximity/srf08.c b/drivers/iio/proximity/srf08.c
> index 49316cbf7c60..3f19536f215f 100644
> --- a/drivers/iio/proximity/srf08.c
> +++ b/drivers/iio/proximity/srf08.c
> @@ -378,6 +378,13 @@ static int srf08_probe(struct i2c_client *client,
>  	return devm_iio_device_register(&client->dev, indio_dev);
>  }
>  
> +static const struct of_device_id of_srf08_match[] = {
> +	{ .compatible = "devantech,srf08", 0},
> +	{},
> +};
> +
> +MODULE_DEVICE_TABLE(of, of_srf08_match);
> +
>  static const struct i2c_device_id srf08_id[] = {
>  	{ "srf08", 0 },
>  	{ }
> @@ -387,6 +394,7 @@ MODULE_DEVICE_TABLE(i2c, srf08_id);
>  static struct i2c_driver srf08_driver = {
>  	.driver = {
>  		.name	= "srf08",
> +		.of_match_table	= of_srf08_match,
>  	},
>  	.probe = srf08_probe,
>  	.id_table = srf08_id,

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web