linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] iio: proximity: mb1232: Switch to use fwnode_irq_get()
@ 2022-04-13 18:31 Andy Shevchenko
  2022-04-16 11:07 ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2022-04-13 18:31 UTC (permalink / raw)
  To: Andy Shevchenko, linux-iio, linux-kernel
  Cc: Andreas Klinger, Jonathan Cameron, Lars-Peter Clausen

We have OF-centric variant of fwnode_irq_get() in the driver.
Replace it with a call to an agnostic implementation.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/proximity/mb1232.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/proximity/mb1232.c b/drivers/iio/proximity/mb1232.c
index ad4b1fb2607a..0bca5f74de68 100644
--- a/drivers/iio/proximity/mb1232.c
+++ b/drivers/iio/proximity/mb1232.c
@@ -10,12 +10,14 @@
  * https://www.maxbotix.com/documents/I2CXL-MaxSonar-EZ_Datasheet.pdf
  */
 
+#include <linux/bitops.h>
 #include <linux/err.h>
 #include <linux/i2c.h>
-#include <linux/of_irq.h>
 #include <linux/delay.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
-#include <linux/bitops.h>
+#include <linux/property.h>
+
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 #include <linux/iio/buffer.h>
@@ -209,7 +211,7 @@ static int mb1232_probe(struct i2c_client *client,
 
 	init_completion(&data->ranging);
 
-	data->irqnr = irq_of_parse_and_map(dev->of_node, 0);
+	data->irqnr = fwnode_irq_get(dev_fwnode(&client->dev), 0);
 	if (data->irqnr <= 0) {
 		/* usage of interrupt is optional */
 		data->irqnr = -1;
-- 
2.35.1


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

* Re: [PATCH v1 1/1] iio: proximity: mb1232: Switch to use fwnode_irq_get()
  2022-04-13 18:31 [PATCH v1 1/1] iio: proximity: mb1232: Switch to use fwnode_irq_get() Andy Shevchenko
@ 2022-04-16 11:07 ` Jonathan Cameron
  2022-04-19 10:24   ` Andreas Klinger
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2022-04-16 11:07 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-iio, linux-kernel, Andreas Klinger, Lars-Peter Clausen

On Wed, 13 Apr 2022 21:31:23 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> We have OF-centric variant of fwnode_irq_get() in the driver.
> Replace it with a call to an agnostic implementation.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Whilst I 'think' this ends up being functionally identical
I'd like to leave it a little longer to see if Andreas has
time to take a look and verify this change is fine.

There seem to be subtle differences in the irq setup as the
new code does a sanity check on the domain being available
and defers if not which I don't think happens with the
existing code.

Thanks,

Jonathan


> ---
>  drivers/iio/proximity/mb1232.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/proximity/mb1232.c b/drivers/iio/proximity/mb1232.c
> index ad4b1fb2607a..0bca5f74de68 100644
> --- a/drivers/iio/proximity/mb1232.c
> +++ b/drivers/iio/proximity/mb1232.c
> @@ -10,12 +10,14 @@
>   * https://www.maxbotix.com/documents/I2CXL-MaxSonar-EZ_Datasheet.pdf
>   */
>  
> +#include <linux/bitops.h>
>  #include <linux/err.h>
>  #include <linux/i2c.h>
> -#include <linux/of_irq.h>
>  #include <linux/delay.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/module.h>
> -#include <linux/bitops.h>
> +#include <linux/property.h>
> +
>  #include <linux/iio/iio.h>
>  #include <linux/iio/sysfs.h>
>  #include <linux/iio/buffer.h>
> @@ -209,7 +211,7 @@ static int mb1232_probe(struct i2c_client *client,
>  
>  	init_completion(&data->ranging);
>  
> -	data->irqnr = irq_of_parse_and_map(dev->of_node, 0);
> +	data->irqnr = fwnode_irq_get(dev_fwnode(&client->dev), 0);
>  	if (data->irqnr <= 0) {
>  		/* usage of interrupt is optional */
>  		data->irqnr = -1;


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

* Re: [PATCH v1 1/1] iio: proximity: mb1232: Switch to use fwnode_irq_get()
  2022-04-16 11:07 ` Jonathan Cameron
@ 2022-04-19 10:24   ` Andreas Klinger
  2022-04-28 18:29     ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Klinger @ 2022-04-19 10:24 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Andy Shevchenko, linux-iio, linux-kernel, Lars-Peter Clausen


Jonathan Cameron <jic23@kernel.org> schrieb am Sa, 16. Apr 12:07:
> On Wed, 13 Apr 2022 21:31:23 +0300
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> 
> > We have OF-centric variant of fwnode_irq_get() in the driver.
> > Replace it with a call to an agnostic implementation.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> Whilst I 'think' this ends up being functionally identical
> I'd like to leave it a little longer to see if Andreas has
> time to take a look and verify this change is fine.
> 
> There seem to be subtle differences in the irq setup as the
> new code does a sanity check on the domain being available
> and defers if not which I don't think happens with the
> existing code.

Anyway interrupts are optional and the driver will work without i don't see any
issue here.

Acked-by: Andreas Klinger <ak@it-klinger.de>

> 
> Thanks,
> 
> Jonathan
> 
> 
> > ---
> >  drivers/iio/proximity/mb1232.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/iio/proximity/mb1232.c b/drivers/iio/proximity/mb1232.c
> > index ad4b1fb2607a..0bca5f74de68 100644
> > --- a/drivers/iio/proximity/mb1232.c
> > +++ b/drivers/iio/proximity/mb1232.c
> > @@ -10,12 +10,14 @@
> >   * https://www.maxbotix.com/documents/I2CXL-MaxSonar-EZ_Datasheet.pdf
> >   */
> >  
> > +#include <linux/bitops.h>
> >  #include <linux/err.h>
> >  #include <linux/i2c.h>
> > -#include <linux/of_irq.h>
> >  #include <linux/delay.h>
> > +#include <linux/mod_devicetable.h>
> >  #include <linux/module.h>
> > -#include <linux/bitops.h>
> > +#include <linux/property.h>
> > +
> >  #include <linux/iio/iio.h>
> >  #include <linux/iio/sysfs.h>
> >  #include <linux/iio/buffer.h>
> > @@ -209,7 +211,7 @@ static int mb1232_probe(struct i2c_client *client,
> >  
> >  	init_completion(&data->ranging);
> >  
> > -	data->irqnr = irq_of_parse_and_map(dev->of_node, 0);
> > +	data->irqnr = fwnode_irq_get(dev_fwnode(&client->dev), 0);
> >  	if (data->irqnr <= 0) {
> >  		/* usage of interrupt is optional */
> >  		data->irqnr = -1;
> 

-- 
Andreas Klinger
Grabenreith 27
84508 Burgkirchen
+49 8623 919966
ak@it-klinger.de
www.it-klinger.de
www.grabenreith.de

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

* Re: [PATCH v1 1/1] iio: proximity: mb1232: Switch to use fwnode_irq_get()
  2022-04-19 10:24   ` Andreas Klinger
@ 2022-04-28 18:29     ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2022-04-28 18:29 UTC (permalink / raw)
  To: Andreas Klinger
  Cc: Andy Shevchenko, linux-iio, linux-kernel, Lars-Peter Clausen

On Tue, 19 Apr 2022 12:24:26 +0200
Andreas Klinger <ak@it-klinger.de> wrote:

> Jonathan Cameron <jic23@kernel.org> schrieb am Sa, 16. Apr 12:07:
> > On Wed, 13 Apr 2022 21:31:23 +0300
> > Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> >   
> > > We have OF-centric variant of fwnode_irq_get() in the driver.
> > > Replace it with a call to an agnostic implementation.
> > > 
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>  
> > 
> > Whilst I 'think' this ends up being functionally identical
> > I'd like to leave it a little longer to see if Andreas has
> > time to take a look and verify this change is fine.
> > 
> > There seem to be subtle differences in the irq setup as the
> > new code does a sanity check on the domain being available
> > and defers if not which I don't think happens with the
> > existing code.  
> 
> Anyway interrupts are optional and the driver will work without i don't see any
> issue here.
> 
> Acked-by: Andreas Klinger <ak@it-klinger.de>

Applied to the togreg branch of iio.git and pushed out as testing to
see if 0-day can find anything we missed.

Thanks,

Jonathan

> 
> > 
> > Thanks,
> > 
> > Jonathan
> > 
> >   
> > > ---
> > >  drivers/iio/proximity/mb1232.c | 8 +++++---
> > >  1 file changed, 5 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/iio/proximity/mb1232.c b/drivers/iio/proximity/mb1232.c
> > > index ad4b1fb2607a..0bca5f74de68 100644
> > > --- a/drivers/iio/proximity/mb1232.c
> > > +++ b/drivers/iio/proximity/mb1232.c
> > > @@ -10,12 +10,14 @@
> > >   * https://www.maxbotix.com/documents/I2CXL-MaxSonar-EZ_Datasheet.pdf
> > >   */
> > >  
> > > +#include <linux/bitops.h>
> > >  #include <linux/err.h>
> > >  #include <linux/i2c.h>
> > > -#include <linux/of_irq.h>
> > >  #include <linux/delay.h>
> > > +#include <linux/mod_devicetable.h>
> > >  #include <linux/module.h>
> > > -#include <linux/bitops.h>
> > > +#include <linux/property.h>
> > > +
> > >  #include <linux/iio/iio.h>
> > >  #include <linux/iio/sysfs.h>
> > >  #include <linux/iio/buffer.h>
> > > @@ -209,7 +211,7 @@ static int mb1232_probe(struct i2c_client *client,
> > >  
> > >  	init_completion(&data->ranging);
> > >  
> > > -	data->irqnr = irq_of_parse_and_map(dev->of_node, 0);
> > > +	data->irqnr = fwnode_irq_get(dev_fwnode(&client->dev), 0);
> > >  	if (data->irqnr <= 0) {
> > >  		/* usage of interrupt is optional */
> > >  		data->irqnr = -1;  
> >   
> 


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

end of thread, other threads:[~2022-04-28 18:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13 18:31 [PATCH v1 1/1] iio: proximity: mb1232: Switch to use fwnode_irq_get() Andy Shevchenko
2022-04-16 11:07 ` Jonathan Cameron
2022-04-19 10:24   ` Andreas Klinger
2022-04-28 18:29     ` 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).