Linux IIO development
 help / color / mirror / Atom feed
* [PATCH] iio: Use dev_fwnode()
       [not found] <20250611104348.192092-1-jirislaby@kernel.org>
@ 2025-06-11 10:43 ` Jiri Slaby (SUSE)
  2025-06-11 13:57   ` David Lechner
  0 siblings, 1 reply; 5+ messages in thread
From: Jiri Slaby (SUSE) @ 2025-06-11 10:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: tglx, Jiri Slaby (SUSE), Jonathan Cameron, David Lechner,
	Nuno Sá, Andy Shevchenko, Maxime Coquelin, Alexandre Torgue,
	linux-iio, linux-stm32, linux-arm-kernel

irq_domain_create_simple() takes fwnode as the first argument. It can be
extracted from the struct device using dev_fwnode() helper instead of
using of_node with of_fwnode_handle().

So use the dev_fwnode() helper.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: David Lechner <dlechner@baylibre.com>
Cc: "Nuno Sá" <nuno.sa@analog.com>
Cc: Andy Shevchenko <andy@kernel.org>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: linux-iio@vger.kernel.org

---
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/iio/adc/stm32-adc-core.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c
index bd3458965bff..58b5838227aa 100644
--- a/drivers/iio/adc/stm32-adc-core.c
+++ b/drivers/iio/adc/stm32-adc-core.c
@@ -407,7 +407,6 @@ static const struct irq_domain_ops stm32_adc_domain_ops = {
 static int stm32_adc_irq_probe(struct platform_device *pdev,
 			       struct stm32_adc_priv *priv)
 {
-	struct device_node *np = pdev->dev.of_node;
 	unsigned int i;
 
 	/*
@@ -421,10 +420,8 @@ static int stm32_adc_irq_probe(struct platform_device *pdev,
 			return priv->irq[i];
 	}
 
-	priv->domain = irq_domain_create_simple(of_fwnode_handle(np),
-						STM32_ADC_MAX_ADCS, 0,
-						&stm32_adc_domain_ops,
-						priv);
+	priv->domain = irq_domain_create_simple(dev_fwnode(&pdev->dev), STM32_ADC_MAX_ADCS, 0,
+						&stm32_adc_domain_ops, priv);
 	if (!priv->domain) {
 		dev_err(&pdev->dev, "Failed to add irq domain\n");
 		return -ENOMEM;
-- 
2.49.0


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

* Re: [PATCH] iio: Use dev_fwnode()
  2025-06-11 10:43 ` [PATCH] iio: Use dev_fwnode() Jiri Slaby (SUSE)
@ 2025-06-11 13:57   ` David Lechner
  2025-06-12  8:46     ` [PATCH v2] iio: adc: stm32-adc: " Jiri Slaby (SUSE)
  0 siblings, 1 reply; 5+ messages in thread
From: David Lechner @ 2025-06-11 13:57 UTC (permalink / raw)
  To: Jiri Slaby (SUSE), linux-kernel
  Cc: tglx, Jonathan Cameron, Nuno Sá, Andy Shevchenko,
	Maxime Coquelin, Alexandre Torgue, linux-iio, linux-stm32,
	linux-arm-kernel

Subject should be "iio: adc: stm32-adc: Use dev_fwnode()"

On 6/11/25 5:43 AM, Jiri Slaby (SUSE) wrote:
> irq_domain_create_simple() takes fwnode as the first argument. It can be
> extracted from the struct device using dev_fwnode() helper instead of
> using of_node with of_fwnode_handle().
> 
> So use the dev_fwnode() helper.
> 

...

> @@ -421,10 +420,8 @@ static int stm32_adc_irq_probe(struct platform_device *pdev,
>  			return priv->irq[i];
>  	}
>  
> -	priv->domain = irq_domain_create_simple(of_fwnode_handle(np),
> -						STM32_ADC_MAX_ADCS, 0,
> -						&stm32_adc_domain_ops,
> -						priv);
> +	priv->domain = irq_domain_create_simple(dev_fwnode(&pdev->dev), STM32_ADC_MAX_ADCS, 0,
> +						&stm32_adc_domain_ops, priv);

In the IIO subsystem, we still usually wrap at 80 characters so
wouldn't want to unwrap the lines here.

>  	if (!priv->domain) {
>  		dev_err(&pdev->dev, "Failed to add irq domain\n");
>  		return -ENOMEM;


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

* [PATCH v2] iio: adc: stm32-adc: Use dev_fwnode()
  2025-06-11 13:57   ` David Lechner
@ 2025-06-12  8:46     ` Jiri Slaby (SUSE)
  2025-06-13 17:00       ` David Lechner
  0 siblings, 1 reply; 5+ messages in thread
From: Jiri Slaby (SUSE) @ 2025-06-12  8:46 UTC (permalink / raw)
  To: jic23
  Cc: tglx, linux-kernel, Jiri Slaby (SUSE), David Lechner,
	Nuno Sá, Andy Shevchenko, Maxime Coquelin, Alexandre Torgue,
	linux-iio, linux-stm32, linux-arm-kernel

irq_domain_create_simple() takes fwnode as the first argument. It can be
extracted from the struct device using dev_fwnode() helper instead of
using of_node with of_fwnode_handle().

So use the dev_fwnode() helper.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: David Lechner <dlechner@baylibre.com>
Cc: "Nuno Sá" <nuno.sa@analog.com>
Cc: Andy Shevchenko <andy@kernel.org>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: linux-iio@vger.kernel.org

---
[v2]
* fix subject
* wrap to 80 chars

Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/iio/adc/stm32-adc-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c
index bd3458965bff..dea166c53369 100644
--- a/drivers/iio/adc/stm32-adc-core.c
+++ b/drivers/iio/adc/stm32-adc-core.c
@@ -407,7 +407,6 @@ static const struct irq_domain_ops stm32_adc_domain_ops = {
 static int stm32_adc_irq_probe(struct platform_device *pdev,
 			       struct stm32_adc_priv *priv)
 {
-	struct device_node *np = pdev->dev.of_node;
 	unsigned int i;
 
 	/*
@@ -421,7 +420,7 @@ static int stm32_adc_irq_probe(struct platform_device *pdev,
 			return priv->irq[i];
 	}
 
-	priv->domain = irq_domain_create_simple(of_fwnode_handle(np),
+	priv->domain = irq_domain_create_simple(dev_fwnode(&pdev->dev),
 						STM32_ADC_MAX_ADCS, 0,
 						&stm32_adc_domain_ops,
 						priv);
-- 
2.49.0


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

* Re: [PATCH v2] iio: adc: stm32-adc: Use dev_fwnode()
  2025-06-12  8:46     ` [PATCH v2] iio: adc: stm32-adc: " Jiri Slaby (SUSE)
@ 2025-06-13 17:00       ` David Lechner
  2025-06-14 11:08         ` Jonathan Cameron
  0 siblings, 1 reply; 5+ messages in thread
From: David Lechner @ 2025-06-13 17:00 UTC (permalink / raw)
  To: Jiri Slaby (SUSE), jic23
  Cc: tglx, linux-kernel, Nuno Sá, Andy Shevchenko,
	Maxime Coquelin, Alexandre Torgue, linux-iio, linux-stm32,
	linux-arm-kernel

On 6/12/25 3:46 AM, Jiri Slaby (SUSE) wrote:
> irq_domain_create_simple() takes fwnode as the first argument. It can be
> extracted from the struct device using dev_fwnode() helper instead of
> using of_node with of_fwnode_handle().
> 
> So use the dev_fwnode() helper.
> 
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
> Cc: Jonathan Cameron <jic23@kernel.org>
> Cc: David Lechner <dlechner@baylibre.com>
> Cc: "Nuno Sá" <nuno.sa@analog.com>
> Cc: Andy Shevchenko <andy@kernel.org>
> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
> Cc: linux-iio@vger.kernel.org
> 
> ---
Reviewed-by: David Lechner <dlechner@baylibre.com>


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

* Re: [PATCH v2] iio: adc: stm32-adc: Use dev_fwnode()
  2025-06-13 17:00       ` David Lechner
@ 2025-06-14 11:08         ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2025-06-14 11:08 UTC (permalink / raw)
  To: David Lechner
  Cc: Jiri Slaby (SUSE), tglx, linux-kernel, Nuno Sá,
	Andy Shevchenko, Maxime Coquelin, Alexandre Torgue, linux-iio,
	linux-stm32, linux-arm-kernel

On Fri, 13 Jun 2025 12:00:10 -0500
David Lechner <dlechner@baylibre.com> wrote:

> On 6/12/25 3:46 AM, Jiri Slaby (SUSE) wrote:
> > irq_domain_create_simple() takes fwnode as the first argument. It can be
> > extracted from the struct device using dev_fwnode() helper instead of
> > using of_node with of_fwnode_handle().
> > 
> > So use the dev_fwnode() helper.
> > 
> > Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
> > Cc: Jonathan Cameron <jic23@kernel.org>
> > Cc: David Lechner <dlechner@baylibre.com>
> > Cc: "Nuno Sá" <nuno.sa@analog.com>
> > Cc: Andy Shevchenko <andy@kernel.org>
> > Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
> > Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
> > Cc: linux-iio@vger.kernel.org
> > 
> > ---  
> Reviewed-by: David Lechner <dlechner@baylibre.com>
> 
> 
Applied. Thanks

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

end of thread, other threads:[~2025-06-14 11:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250611104348.192092-1-jirislaby@kernel.org>
2025-06-11 10:43 ` [PATCH] iio: Use dev_fwnode() Jiri Slaby (SUSE)
2025-06-11 13:57   ` David Lechner
2025-06-12  8:46     ` [PATCH v2] iio: adc: stm32-adc: " Jiri Slaby (SUSE)
2025-06-13 17:00       ` David Lechner
2025-06-14 11:08         ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox