Commit bcca9220 authored by Srinivas Kandagatla's avatar Srinivas Kandagatla Committed by Linus Walleij

pinctrl: st: Fix error check for of_irq_to_resource usage

This patch fixes an error check while using of_irq_to_resource.
of_irq_to_resource returns non-zero interrupt number on success and zero
on error. The driver was using error check is wrong way.

Without this patch the driver will configure interrupt zero if there is
no interrupt specified in the node.
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 93cfb2d8
...@@ -1569,7 +1569,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info, ...@@ -1569,7 +1569,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info,
* [irqN]----> [gpio-bank (n)] * [irqN]----> [gpio-bank (n)]
*/ */
if (!of_irq_to_resource(np, 0, &irq_res)) { if (of_irq_to_resource(np, 0, &irq_res)) {
gpio_irq = irq_res.start; gpio_irq = irq_res.start;
irq_set_chained_handler(gpio_irq, st_gpio_irq_handler); irq_set_chained_handler(gpio_irq, st_gpio_irq_handler);
irq_set_handler_data(gpio_irq, bank); irq_set_handler_data(gpio_irq, bank);
......
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