]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
platform: use fwnode_irq_get_byname instead of of_irq_get_byname to get irq
authorSoha Jin <soha@lohu.info>
Fri, 30 Sep 2022 16:26:04 +0000 (00:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2022 17:56:47 +0000 (18:56 +0100)
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.

Signed-off-by: Soha Jin <soha@lohu.info>
Tested-by: Wende Tan <twd2.me@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/platform.c

index 51bb2289865c7222c0a2d1d6f4e8ad02225f9105..968f3d71eeab2e9fe5cdf552908c79bd4cdad580 100644 (file)
@@ -441,8 +441,8 @@ 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 (!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;
        }