summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-ixp4xx.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-05-23 12:49:47 +0300
committerLinus Walleij <linus.walleij@linaro.org>2019-05-28 11:28:15 +0300
commit315c1a8ebd74386e629fe03b220117a00a22afc0 (patch)
tree8e784c785951f8cf1489078c06f4d7196fa5223d /drivers/gpio/gpio-ixp4xx.c
parent4b3d50062ce06530adc27224a1e10f087d0c9caf (diff)
downloadlinux-315c1a8ebd74386e629fe03b220117a00a22afc0.tar.xz
gpio: ixp4xx: Use irq_domain_translate_twocell()
Use standard functions. Eventually we will be able to drop all checks and just assign irq_domain_translate_twocell() to this callback. Cc: Brian Masney <masneyb@onstation.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-ixp4xx.c')
-rw-r--r--drivers/gpio/gpio-ixp4xx.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpio/gpio-ixp4xx.c b/drivers/gpio/gpio-ixp4xx.c
index 4b1cf7ea858d..670c2a85a35b 100644
--- a/drivers/gpio/gpio-ixp4xx.c
+++ b/drivers/gpio/gpio-ixp4xx.c
@@ -205,20 +205,20 @@ static int ixp4xx_gpio_irq_domain_translate(struct irq_domain *domain,
unsigned long *hwirq,
unsigned int *type)
{
+ int ret;
/* We support standard DT translation */
if (is_of_node(fwspec->fwnode) && fwspec->param_count == 2) {
- *hwirq = fwspec->param[0];
- *type = fwspec->param[1];
- return 0;
+ return irq_domain_translate_twocell(domain, fwspec,
+ hwirq, type);
}
/* This goes away when we transition to DT */
if (is_fwnode_irqchip(fwspec->fwnode)) {
- if (fwspec->param_count != 2)
- return -EINVAL;
- *hwirq = fwspec->param[0];
- *type = fwspec->param[1];
+ ret = irq_domain_translate_twocell(domain, fwspec,
+ hwirq, type);
+ if (ret)
+ return ret;
WARN_ON(*type == IRQ_TYPE_NONE);
return 0;
}