From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Soha Jin <soha@lohu.info>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH driver-core-next] platform: remove useless if-branch in __platform_get_irq_byname()
Date: Tue, 17 Jan 2023 19:11:53 +0100 [thread overview]
Message-ID: <Y8bk6bXGOWp8aPze@kroah.com> (raw)
In-Reply-To: <20221111094542.270540-1-soha@lohu.info>
On Fri, Nov 11, 2022 at 05:45:42PM +0800, Soha Jin wrote:
> When CONFIG_OF_IRQ is not enabled, there will be a stub method that always
> returns 0 when getting IRQ. Thus, the if-branch can be removed safely.
>
> Fixes: d4ad017d6345 ("platform: use fwnode_irq_get_byname instead of of_irq_get_byname to get irq")
> Signed-off-by: Soha Jin <soha@lohu.info>
> ---
> 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 968f3d71eeab..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 (!dev->dev.of_node || IS_ENABLED(CONFIG_OF_IRQ)) {
> - ret = fwnode_irq_get_byname(dev_fwnode(&dev->dev), 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;
It's not really a "fix", so I'll be dropping that tag here.
thanks,
greg k-h
prev parent reply other threads:[~2023-01-17 18:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-11 9:45 [PATCH driver-core-next] platform: remove useless if-branch in __platform_get_irq_byname() Soha Jin
2022-11-30 16:13 ` Soha Jin
2023-01-17 18:11 ` Greg Kroah-Hartman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y8bk6bXGOWp8aPze@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=soha@lohu.info \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.