aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-st.c
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@st.com>2014-03-12 09:35:05 -0400
committerLinus Walleij <linus.walleij@linaro.org>2014-03-12 10:53:44 -0400
commitbcca9220b211b9668c23c9d8ccb0a3d29716482b (patch)
treece8457f7eb42534996e753455661e5709698e15f /drivers/pinctrl/pinctrl-st.c
parent93cfb2d86285a7aa9a9ca47bff44d3035005cb8c (diff)
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: Srinivas Kandagatla <srinivas.kandagatla@st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-st.c')
-rw-r--r--drivers/pinctrl/pinctrl-st.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c
index e4c4799b0af8..bd725b0a4341 100644
--- a/drivers/pinctrl/pinctrl-st.c
+++ b/drivers/pinctrl/pinctrl-st.c
@@ -1569,7 +1569,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info,
1569 * [irqN]----> [gpio-bank (n)] 1569 * [irqN]----> [gpio-bank (n)]
1570 */ 1570 */
1571 1571
1572 if (!of_irq_to_resource(np, 0, &irq_res)) { 1572 if (of_irq_to_resource(np, 0, &irq_res)) {
1573 gpio_irq = irq_res.start; 1573 gpio_irq = irq_res.start;
1574 irq_set_chained_handler(gpio_irq, st_gpio_irq_handler); 1574 irq_set_chained_handler(gpio_irq, st_gpio_irq_handler);
1575 irq_set_handler_data(gpio_irq, bank); 1575 irq_set_handler_data(gpio_irq, bank);