Commit 86851bbc authored by Andy Shevchenko's avatar Andy Shevchenko

pinctrl: intel: Make use of IRQ_RETVAL()

Instead of using bitwise operations against returned values,
which is a bit fragile, convert IRQ handler to count amount of
GPIO groups, where at least one interrupt happened, and convert
it to returned value by IRQ_RETVAL() macro.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent f62cdde5
...@@ -1093,12 +1093,12 @@ static int intel_gpio_irq_wake(struct irq_data *d, unsigned int on) ...@@ -1093,12 +1093,12 @@ static int intel_gpio_irq_wake(struct irq_data *d, unsigned int on)
return 0; return 0;
} }
static irqreturn_t intel_gpio_community_irq_handler(struct intel_pinctrl *pctrl, static int intel_gpio_community_irq_handler(struct intel_pinctrl *pctrl,
const struct intel_community *community) const struct intel_community *community)
{ {
struct gpio_chip *gc = &pctrl->chip; struct gpio_chip *gc = &pctrl->chip;
irqreturn_t ret = IRQ_NONE; unsigned int gpp;
int gpp; int ret = 0;
for (gpp = 0; gpp < community->ngpps; gpp++) { for (gpp = 0; gpp < community->ngpps; gpp++) {
const struct intel_padgroup *padgrp = &community->gpps[gpp]; const struct intel_padgroup *padgrp = &community->gpps[gpp];
...@@ -1118,9 +1118,9 @@ static irqreturn_t intel_gpio_community_irq_handler(struct intel_pinctrl *pctrl, ...@@ -1118,9 +1118,9 @@ static irqreturn_t intel_gpio_community_irq_handler(struct intel_pinctrl *pctrl,
irq = irq_find_mapping(gc->irq.domain, irq = irq_find_mapping(gc->irq.domain,
padgrp->gpio_base + gpp_offset); padgrp->gpio_base + gpp_offset);
generic_handle_irq(irq); generic_handle_irq(irq);
ret |= IRQ_HANDLED;
} }
ret += pending ? 1 : 0;
} }
return ret; return ret;
...@@ -1130,16 +1130,16 @@ static irqreturn_t intel_gpio_irq(int irq, void *data) ...@@ -1130,16 +1130,16 @@ static irqreturn_t intel_gpio_irq(int irq, void *data)
{ {
const struct intel_community *community; const struct intel_community *community;
struct intel_pinctrl *pctrl = data; struct intel_pinctrl *pctrl = data;
irqreturn_t ret = IRQ_NONE; unsigned int i;
int i; int ret = 0;
/* Need to check all communities for pending interrupts */ /* Need to check all communities for pending interrupts */
for (i = 0; i < pctrl->ncommunities; i++) { for (i = 0; i < pctrl->ncommunities; i++) {
community = &pctrl->communities[i]; community = &pctrl->communities[i];
ret |= intel_gpio_community_irq_handler(pctrl, community); ret += intel_gpio_community_irq_handler(pctrl, community);
} }
return ret; return IRQ_RETVAL(ret);
} }
static int intel_gpio_add_community_ranges(struct intel_pinctrl *pctrl, static int intel_gpio_add_community_ranges(struct intel_pinctrl *pctrl,
......
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