linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] platform: use fwnode_irq_get_byname instead of of_irq_get_byname to get irq
@ 2022-10-28 16:41 Soha Jin
  2022-11-11  8:30 ` Soha Jin
  0 siblings, 1 reply; 4+ messages in thread
From: Soha Jin @ 2022-10-28 16:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Rafael J. Wysocki, linux-kernel, Wende Tan, Soha Jin

Not only platform devices described by OF have named interrupts, but
devices described by ACPI also have named interrupts. The fwnode is an
abstraction to different standards, and using fwnode_irq_get_byname can
support more devices.

Moreover, when CONFIG_OF_IRQ is not enabled, there will be a stub method
always returning 0, the if statement can be removed safely.

Signed-off-by: Soha Jin <soha@lohu.info>
Tested-by: Wende Tan <twd2.me@gmail.com>
---
 drivers/base/platform.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 51bb2289865c..6cd7fd478c5f 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -441,11 +441,9 @@ static int __platform_get_irq_byname(struct platform_device *dev,
 	struct resource *r;
 	int ret;
 
-	if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) {
-		ret = of_irq_get_byname(dev->dev.of_node, name);
-		if (ret > 0 || ret == -EPROBE_DEFER)
-			return ret;
-	}
+	ret = fwnode_irq_get_byname(dev_fwnode(&dev->dev), name);
+	if (ret > 0 || ret == -EPROBE_DEFER)
+		return ret;
 
 	r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name);
 	if (r) {
-- 
2.30.2


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

* RE: [PATCH v2] platform: use fwnode_irq_get_byname instead of of_irq_get_byname to get irq
  2022-10-28 16:41 [PATCH v2] platform: use fwnode_irq_get_byname instead of of_irq_get_byname to get irq Soha Jin
@ 2022-11-11  8:30 ` Soha Jin
  2022-11-11  8:52   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Soha Jin @ 2022-11-11  8:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Rafael J. Wysocki, linux-kernel, Wende Tan

> -----Original Message-----
> From: Soha Jin <soha@lohu.info>
> Sent: Saturday, October 29, 2022 12:41 AM
> 
> Not only platform devices described by OF have named interrupts, but
> devices described by ACPI also have named interrupts. The fwnode is an
> abstraction to different standards, and using fwnode_irq_get_byname can
> support more devices.
> 
> Moreover, when CONFIG_OF_IRQ is not enabled, there will be a stub method
> always returning 0, the if statement can be removed safely.
> 
> Signed-off-by: Soha Jin <soha@lohu.info>
> Tested-by: Wende Tan <twd2.me@gmail.com>
> ---
>  drivers/base/platform.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c index
> 51bb2289865c..6cd7fd478c5f 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -441,11 +441,9 @@ static int __platform_get_irq_byname(struct
> platform_device *dev,
>  	struct resource *r;
>  	int ret;
> 
> -	if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) {
> -		ret = of_irq_get_byname(dev->dev.of_node, name);
> -		if (ret > 0 || ret == -EPROBE_DEFER)
> -			return ret;
> -	}
> +	ret = fwnode_irq_get_byname(dev_fwnode(&dev->dev), name);
> +	if (ret > 0 || ret == -EPROBE_DEFER)
> +		return ret;
> 
>  	r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name);
>  	if (r) {
> --
> 2.30.2
> 

Hello Greg,

I noticed the original patch is merged into -next branch, but as I said in
the mail yesterday (maybe you did not see it), I already composed a v2
patch 2 weeks ago. Except the formatting fix, this patch also removed a
useless if-branch.

Are there any chance to correct this mistake?

Regards,
Soha


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

* Re: [PATCH v2] platform: use fwnode_irq_get_byname instead of of_irq_get_byname to get irq
  2022-11-11  8:30 ` Soha Jin
@ 2022-11-11  8:52   ` Greg Kroah-Hartman
  2022-11-11  9:42     ` Soha Jin
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-11  8:52 UTC (permalink / raw)
  To: Soha Jin; +Cc: Rafael J. Wysocki, linux-kernel, Wende Tan

On Fri, Nov 11, 2022 at 08:30:46AM +0000, Soha Jin wrote:
> > -----Original Message-----
> > From: Soha Jin <soha@lohu.info>
> > Sent: Saturday, October 29, 2022 12:41 AM
> > 
> > Not only platform devices described by OF have named interrupts, but
> > devices described by ACPI also have named interrupts. The fwnode is an
> > abstraction to different standards, and using fwnode_irq_get_byname can
> > support more devices.
> > 
> > Moreover, when CONFIG_OF_IRQ is not enabled, there will be a stub method
> > always returning 0, the if statement can be removed safely.
> > 
> > Signed-off-by: Soha Jin <soha@lohu.info>
> > Tested-by: Wende Tan <twd2.me@gmail.com>
> > ---
> >  drivers/base/platform.c | 8 +++-----
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/base/platform.c b/drivers/base/platform.c index
> > 51bb2289865c..6cd7fd478c5f 100644
> > --- a/drivers/base/platform.c
> > +++ b/drivers/base/platform.c
> > @@ -441,11 +441,9 @@ static int __platform_get_irq_byname(struct
> > platform_device *dev,
> >  	struct resource *r;
> >  	int ret;
> > 
> > -	if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) {
> > -		ret = of_irq_get_byname(dev->dev.of_node, name);
> > -		if (ret > 0 || ret == -EPROBE_DEFER)
> > -			return ret;
> > -	}
> > +	ret = fwnode_irq_get_byname(dev_fwnode(&dev->dev), name);
> > +	if (ret > 0 || ret == -EPROBE_DEFER)
> > +		return ret;
> > 
> >  	r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name);
> >  	if (r) {
> > --
> > 2.30.2
> > 
> 
> Hello Greg,
> 
> I noticed the original patch is merged into -next branch, but as I said in
> the mail yesterday (maybe you did not see it), I already composed a v2
> patch 2 weeks ago. Except the formatting fix, this patch also removed a
> useless if-branch.
> 
> Are there any chance to correct this mistake?

Please submit a fixup patch, sorry, I can't rebase that branch now.

greg k-h

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

* RE: [PATCH v2] platform: use fwnode_irq_get_byname instead of of_irq_get_byname to get irq
  2022-11-11  8:52   ` Greg Kroah-Hartman
@ 2022-11-11  9:42     ` Soha Jin
  0 siblings, 0 replies; 4+ messages in thread
From: Soha Jin @ 2022-11-11  9:42 UTC (permalink / raw)
  To: 'Greg Kroah-Hartman'
  Cc: 'Rafael J. Wysocki', linux-kernel, 'Wende Tan'

> -----Original Message-----
> From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Sent: Friday, November 11, 2022 4:52 PM
> 
> Please submit a fixup patch, sorry, I can't rebase that branch now.
> 
> greg k-h

Got it, I withdraw this patch.

Soha


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

end of thread, other threads:[~2022-11-11  9:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-28 16:41 [PATCH v2] platform: use fwnode_irq_get_byname instead of of_irq_get_byname to get irq Soha Jin
2022-11-11  8:30 ` Soha Jin
2022-11-11  8:52   ` Greg Kroah-Hartman
2022-11-11  9:42     ` Soha Jin

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).