Commit 315c1a8e authored by Linus Walleij's avatar Linus Walleij

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: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 4b3d5006
...@@ -205,20 +205,20 @@ static int ixp4xx_gpio_irq_domain_translate(struct irq_domain *domain, ...@@ -205,20 +205,20 @@ static int ixp4xx_gpio_irq_domain_translate(struct irq_domain *domain,
unsigned long *hwirq, unsigned long *hwirq,
unsigned int *type) unsigned int *type)
{ {
int ret;
/* We support standard DT translation */ /* We support standard DT translation */
if (is_of_node(fwspec->fwnode) && fwspec->param_count == 2) { if (is_of_node(fwspec->fwnode) && fwspec->param_count == 2) {
*hwirq = fwspec->param[0]; return irq_domain_translate_twocell(domain, fwspec,
*type = fwspec->param[1]; hwirq, type);
return 0;
} }
/* This goes away when we transition to DT */ /* This goes away when we transition to DT */
if (is_fwnode_irqchip(fwspec->fwnode)) { if (is_fwnode_irqchip(fwspec->fwnode)) {
if (fwspec->param_count != 2) ret = irq_domain_translate_twocell(domain, fwspec,
return -EINVAL; hwirq, type);
*hwirq = fwspec->param[0]; if (ret)
*type = fwspec->param[1]; return ret;
WARN_ON(*type == IRQ_TYPE_NONE); WARN_ON(*type == IRQ_TYPE_NONE);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment