]> git.baikalelectronics.ru Git - kernel.git/commit
drivers: platform: parse IRQ flags from resources
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 18 Feb 2015 16:12:18 +0000 (17:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Mar 2015 14:04:32 +0000 (15:04 +0100)
commitbd89f6fe56a1c2da9f3ffd1a3381fe9591add1ef
tree5945f68e6efa24d2bec09c1f7f53f29e5c8a9fde
parent459ced5a1038016b7d24b72caf82bf6d29a070bf
drivers: platform: parse IRQ flags from resources

This fixes a regression from the net subsystem:
After commit a16a5da77df880f49357bb1f5350ee735993e8b0
"smc91x: retrieve IRQ and trigger flags in a modern way"
a regression would appear on some legacy platforms such
as the ARM PXA Zylonite that specify IRQ resources like
this:

static struct resource r = {
       .start  = X,
       .end    = X,
       .flags  = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
};

The previous code would retrieve the resource and parse
the high edge setting in the SMC91x driver, a use pattern
that means every driver specifying an IRQ flag from a
static resource need to parse resource flags and apply
them at runtime.

As we switched the code to use IRQ descriptors to retrieve
the the trigger type like this:

  irqd_get_trigger_type(irq_get_irq_data(...));

the code would work for new platforms using e.g. device
tree as the backing irq descriptor would have its flags
properly set, whereas this kind of oldstyle static
resources at no point assign the trigger flags to the
corresponding IRQ descriptor.

To make the behaviour identical on modern device tree
and legacy static platform data platforms, modify
platform_get_irq() to assign the trigger flags to the
irq descriptor when a client looks up an IRQ from static
resources.

Fixes: a16a5da77df8 ("smc91x: retrieve IRQ and trigger flags in a modern way")
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/platform.c