[PATCH] pinctrl: st: Fix error check for of_irq_to_resource usage
From: srinivas.kandagatla
Date: Wed Mar 12 2014 - 10:13:42 EST
From: Srinivas Kandagatla <srinivas.kandagatla@xxxxxx>
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: Srinivas Kandagatla <srinivas.kandagatla@xxxxxx>
---
drivers/pinctrl/pinctrl-st.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
index 51e4f3a..19b8f91 100644
--- a/drivers/pinctrl/pinctrl-st.c
+++ b/drivers/pinctrl/pinctrl-st.c
@@ -1426,7 +1426,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info,
* [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;
irq_set_chained_handler(gpio_irq, st_gpio_irq_handler);
irq_set_handler_data(gpio_irq, bank);
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/