summaryrefslogtreecommitdiffstats
path: root/drivers/base/platform.c
diff options
context:
space:
mode:
authorSoha Jin <soha@lohu.info>2022-11-11 10:45:42 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-17 19:12:48 +0100
commit9dd4541b1693e9aa124a167b40e294aa6906433f (patch)
tree11b9f34bc71d0dee5aa53ac67f42cd258ee52a99 /drivers/base/platform.c
parentserial: arc_uart: Drop empty platform remove function (diff)
downloadlinux-9dd4541b1693e9aa124a167b40e294aa6906433f.tar.xz
linux-9dd4541b1693e9aa124a167b40e294aa6906433f.zip
platform: remove useless if-branch in __platform_get_irq_byname()
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. Signed-off-by: Soha Jin <soha@lohu.info> Link: https://lore.kernel.org/r/20221111094542.270540-1-soha@lohu.info Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/platform.c')
-rw-r--r--drivers/base/platform.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index d6690d705314..b10a130cd433 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;
r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name);
if (r) {