pinctrl: mediatek: Fix pinctrl register irq fail bug.
authorHongzhou Yang <hongzhou.yang@mediatek.com>
Wed, 27 May 2015 09:43:55 +0000 (02:43 -0700)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 2 Jun 2015 09:08:03 +0000 (11:08 +0200)
Since mt6397 is no need to support interrupt controller,
I judged "interrupt-controller" property to skip it last patch.
But the if judgement should on the contrary, this is a bug.

And find of_property_read_bool is better for this case.
So using of_property_read_bool instead of of_find_property.

Also fix bug of misuse pointer.

Signed-off-by: Hongzhou Yang <hongzhou.yang@mediatek.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/mediatek/pinctrl-mtk-common.c

index cd227295c2e6f5c6f796297b18c2654177b5fac9..f206a54a3ca49a515c6b1de1bb67e1eb44a6cbda 100644 (file)
@@ -1280,7 +1280,7 @@ int mtk_pctrl_init(struct platform_device *pdev,
                goto pctrl_error;
        }
 
-       pctl->chip = &mtk_gpio_chip;
+       *pctl->chip = mtk_gpio_chip;
        pctl->chip->ngpio = pctl->devdata->npins;
        pctl->chip->label = dev_name(&pdev->dev);
        pctl->chip->dev = &pdev->dev;
@@ -1300,7 +1300,7 @@ int mtk_pctrl_init(struct platform_device *pdev,
                goto chip_error;
        }
 
-       if (of_find_property(np, "interrupt-controller", NULL))
+       if (!of_property_read_bool(np, "interrupt-controller"))
                return 0;
 
        /* Get EINT register base from dts. */