linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: light: fix vcnl4000 devicetree hooks
@ 2019-09-17 14:56 Marco Felsch
  2019-09-17 14:56 ` [PATCH 2/2] iio: light: add missing vcnl4040 of_compatible Marco Felsch
  2019-09-18 14:46 ` [PATCH 1/2] iio: light: fix vcnl4000 devicetree hooks Angus Ainslie
  0 siblings, 2 replies; 6+ messages in thread
From: Marco Felsch @ 2019-09-17 14:56 UTC (permalink / raw)
  To: jic23, knaack.h, lars, angus, tomas; +Cc: linux-iio, kernel

Since commit ebd457d55911 ("iio: light: vcnl4000 add devicetree hooks")
the of_match_table is supported but the data shouldn't be a string.
Instead it shall be one of 'enum vcnl4000_device_ids'. Also the matching
logic for the vcnl4020 was wrong. Since the data retrieve mechanism is
still based on the i2c_device_id no failures did appeared till now.

Fixes: ebd457d55911 ("iio: light: vcnl4000 add devicetree hooks")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/iio/light/vcnl4000.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index 51421ac32517..f522cb863e8c 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -398,19 +398,19 @@ static int vcnl4000_probe(struct i2c_client *client,
 static const struct of_device_id vcnl_4000_of_match[] = {
 	{
 		.compatible = "vishay,vcnl4000",
-		.data = "VCNL4000",
+		.data = (void *)VCNL4000,
 	},
 	{
 		.compatible = "vishay,vcnl4010",
-		.data = "VCNL4010",
+		.data = (void *)VCNL4010,
 	},
 	{
-		.compatible = "vishay,vcnl4010",
-		.data = "VCNL4020",
+		.compatible = "vishay,vcnl4020",
+		.data = (void *)VCNL4010,
 	},
 	{
 		.compatible = "vishay,vcnl4200",
-		.data = "VCNL4200",
+		.data = (void *)VCNL4200,
 	},
 	{},
 };
-- 
2.20.1


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

* [PATCH 2/2] iio: light: add missing vcnl4040 of_compatible
  2019-09-17 14:56 [PATCH 1/2] iio: light: fix vcnl4000 devicetree hooks Marco Felsch
@ 2019-09-17 14:56 ` Marco Felsch
  2019-09-18 14:47   ` Angus Ainslie
  2019-09-18 14:46 ` [PATCH 1/2] iio: light: fix vcnl4000 devicetree hooks Angus Ainslie
  1 sibling, 1 reply; 6+ messages in thread
From: Marco Felsch @ 2019-09-17 14:56 UTC (permalink / raw)
  To: jic23, knaack.h, lars, angus, tomas; +Cc: linux-iio, kernel

Commit 5a441aade5b3 ("iio: light: vcnl4000 add support for the VCNL4040
proximity and light sensor") added the support for the vcnl4040 but
forgot to add the of_compatible. Fix this by adding it now.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 drivers/iio/light/vcnl4000.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index f522cb863e8c..16dacea9eadf 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -408,6 +408,10 @@ static const struct of_device_id vcnl_4000_of_match[] = {
 		.compatible = "vishay,vcnl4020",
 		.data = (void *)VCNL4010,
 	},
+	{
+		.compatible = "vishay,vcnl4040",
+		.data = (void *)VCNL4040,
+	},
 	{
 		.compatible = "vishay,vcnl4200",
 		.data = (void *)VCNL4200,
-- 
2.20.1


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

* Re: [PATCH 1/2] iio: light: fix vcnl4000 devicetree hooks
  2019-09-17 14:56 [PATCH 1/2] iio: light: fix vcnl4000 devicetree hooks Marco Felsch
  2019-09-17 14:56 ` [PATCH 2/2] iio: light: add missing vcnl4040 of_compatible Marco Felsch
@ 2019-09-18 14:46 ` Angus Ainslie
  2019-10-05 12:27   ` Jonathan Cameron
  1 sibling, 1 reply; 6+ messages in thread
From: Angus Ainslie @ 2019-09-18 14:46 UTC (permalink / raw)
  To: Marco Felsch; +Cc: jic23, knaack.h, lars, tomas, linux-iio, kernel

On 2019-09-17 07:56, Marco Felsch wrote:
> Since commit ebd457d55911 ("iio: light: vcnl4000 add devicetree hooks")
> the of_match_table is supported but the data shouldn't be a string.
> Instead it shall be one of 'enum vcnl4000_device_ids'. Also the 
> matching
> logic for the vcnl4020 was wrong. Since the data retrieve mechanism is
> still based on the i2c_device_id no failures did appeared till now.
> 
> Fixes: ebd457d55911 ("iio: light: vcnl4000 add devicetree hooks")
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>

Reviewed-by: Angus Ainslie (Purism) angus@akkea.ca

> ---
>  drivers/iio/light/vcnl4000.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iio/light/vcnl4000.c 
> b/drivers/iio/light/vcnl4000.c
> index 51421ac32517..f522cb863e8c 100644
> --- a/drivers/iio/light/vcnl4000.c
> +++ b/drivers/iio/light/vcnl4000.c
> @@ -398,19 +398,19 @@ static int vcnl4000_probe(struct i2c_client 
> *client,
>  static const struct of_device_id vcnl_4000_of_match[] = {
>  	{
>  		.compatible = "vishay,vcnl4000",
> -		.data = "VCNL4000",
> +		.data = (void *)VCNL4000,
>  	},
>  	{
>  		.compatible = "vishay,vcnl4010",
> -		.data = "VCNL4010",
> +		.data = (void *)VCNL4010,
>  	},
>  	{
> -		.compatible = "vishay,vcnl4010",
> -		.data = "VCNL4020",
> +		.compatible = "vishay,vcnl4020",
> +		.data = (void *)VCNL4010,
>  	},
>  	{
>  		.compatible = "vishay,vcnl4200",
> -		.data = "VCNL4200",
> +		.data = (void *)VCNL4200,
>  	},
>  	{},
>  };

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

* Re: [PATCH 2/2] iio: light: add missing vcnl4040 of_compatible
  2019-09-17 14:56 ` [PATCH 2/2] iio: light: add missing vcnl4040 of_compatible Marco Felsch
@ 2019-09-18 14:47   ` Angus Ainslie
  2019-10-05 12:30     ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Angus Ainslie @ 2019-09-18 14:47 UTC (permalink / raw)
  To: Marco Felsch; +Cc: jic23, knaack.h, lars, tomas, linux-iio, kernel

On 2019-09-17 07:56, Marco Felsch wrote:
> Commit 5a441aade5b3 ("iio: light: vcnl4000 add support for the VCNL4040
> proximity and light sensor") added the support for the vcnl4040 but
> forgot to add the of_compatible. Fix this by adding it now.
> 
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>

Reviewed-by: Angus Ainslie (Purism) angus@akkea.ca

> ---
>  drivers/iio/light/vcnl4000.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/iio/light/vcnl4000.c 
> b/drivers/iio/light/vcnl4000.c
> index f522cb863e8c..16dacea9eadf 100644
> --- a/drivers/iio/light/vcnl4000.c
> +++ b/drivers/iio/light/vcnl4000.c
> @@ -408,6 +408,10 @@ static const struct of_device_id 
> vcnl_4000_of_match[] = {
>  		.compatible = "vishay,vcnl4020",
>  		.data = (void *)VCNL4010,
>  	},
> +	{
> +		.compatible = "vishay,vcnl4040",
> +		.data = (void *)VCNL4040,
> +	},
>  	{
>  		.compatible = "vishay,vcnl4200",
>  		.data = (void *)VCNL4200,

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

* Re: [PATCH 1/2] iio: light: fix vcnl4000 devicetree hooks
  2019-09-18 14:46 ` [PATCH 1/2] iio: light: fix vcnl4000 devicetree hooks Angus Ainslie
@ 2019-10-05 12:27   ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2019-10-05 12:27 UTC (permalink / raw)
  To: Angus Ainslie; +Cc: Marco Felsch, knaack.h, lars, tomas, linux-iio, kernel

On Wed, 18 Sep 2019 07:46:56 -0700
Angus Ainslie <angus@akkea.ca> wrote:

> On 2019-09-17 07:56, Marco Felsch wrote:
> > Since commit ebd457d55911 ("iio: light: vcnl4000 add devicetree hooks")
> > the of_match_table is supported but the data shouldn't be a string.
> > Instead it shall be one of 'enum vcnl4000_device_ids'. Also the 
> > matching
> > logic for the vcnl4020 was wrong. Since the data retrieve mechanism is
> > still based on the i2c_device_id no failures did appeared till now.
> > 
> > Fixes: ebd457d55911 ("iio: light: vcnl4000 add devicetree hooks")
> > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>  
> 
> Reviewed-by: Angus Ainslie (Purism) angus@akkea.ca
Applied to the fixes-togreg branch of iio.git and marked for stable.

It might not have impact, but it's clearly wrong so lets get
it fixed in stable branches.  Oops to letting this one through.

Jonathan

> 
> > ---
> >  drivers/iio/light/vcnl4000.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/iio/light/vcnl4000.c 
> > b/drivers/iio/light/vcnl4000.c
> > index 51421ac32517..f522cb863e8c 100644
> > --- a/drivers/iio/light/vcnl4000.c
> > +++ b/drivers/iio/light/vcnl4000.c
> > @@ -398,19 +398,19 @@ static int vcnl4000_probe(struct i2c_client 
> > *client,
> >  static const struct of_device_id vcnl_4000_of_match[] = {
> >  	{
> >  		.compatible = "vishay,vcnl4000",
> > -		.data = "VCNL4000",
> > +		.data = (void *)VCNL4000,
> >  	},
> >  	{
> >  		.compatible = "vishay,vcnl4010",
> > -		.data = "VCNL4010",
> > +		.data = (void *)VCNL4010,
> >  	},
> >  	{
> > -		.compatible = "vishay,vcnl4010",
> > -		.data = "VCNL4020",
> > +		.compatible = "vishay,vcnl4020",
> > +		.data = (void *)VCNL4010,
> >  	},
> >  	{
> >  		.compatible = "vishay,vcnl4200",
> > -		.data = "VCNL4200",
> > +		.data = (void *)VCNL4200,
> >  	},
> >  	{},
> >  };  


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

* Re: [PATCH 2/2] iio: light: add missing vcnl4040 of_compatible
  2019-09-18 14:47   ` Angus Ainslie
@ 2019-10-05 12:30     ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2019-10-05 12:30 UTC (permalink / raw)
  To: Angus Ainslie; +Cc: Marco Felsch, knaack.h, lars, tomas, linux-iio, kernel

On Wed, 18 Sep 2019 07:47:31 -0700
Angus Ainslie <angus@akkea.ca> wrote:

> On 2019-09-17 07:56, Marco Felsch wrote:
> > Commit 5a441aade5b3 ("iio: light: vcnl4000 add support for the VCNL4040
> > proximity and light sensor") added the support for the vcnl4040 but
> > forgot to add the of_compatible. Fix this by adding it now.
> > 
> > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>  
> 
> Reviewed-by: Angus Ainslie (Purism) angus@akkea.ca
I turned the above note on what missed this into a fixes tag and 
marked it for stable.  It's no a particularly critical fix, but it
is fairly trivial and very unlikely to have side effects so lets
get it tidied up everywhere.

Thanks,

Jonathan
 
> 
> > ---
> >  drivers/iio/light/vcnl4000.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/iio/light/vcnl4000.c 
> > b/drivers/iio/light/vcnl4000.c
> > index f522cb863e8c..16dacea9eadf 100644
> > --- a/drivers/iio/light/vcnl4000.c
> > +++ b/drivers/iio/light/vcnl4000.c
> > @@ -408,6 +408,10 @@ static const struct of_device_id 
> > vcnl_4000_of_match[] = {
> >  		.compatible = "vishay,vcnl4020",
> >  		.data = (void *)VCNL4010,
> >  	},
> > +	{
> > +		.compatible = "vishay,vcnl4040",
> > +		.data = (void *)VCNL4040,
> > +	},
> >  	{
> >  		.compatible = "vishay,vcnl4200",
> >  		.data = (void *)VCNL4200,  


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

end of thread, other threads:[~2019-10-05 12:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-17 14:56 [PATCH 1/2] iio: light: fix vcnl4000 devicetree hooks Marco Felsch
2019-09-17 14:56 ` [PATCH 2/2] iio: light: add missing vcnl4040 of_compatible Marco Felsch
2019-09-18 14:47   ` Angus Ainslie
2019-10-05 12:30     ` Jonathan Cameron
2019-09-18 14:46 ` [PATCH 1/2] iio: light: fix vcnl4000 devicetree hooks Angus Ainslie
2019-10-05 12:27   ` 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).