pinctrl: fix return value in bcm2835_pinctrl_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Sun, 7 Oct 2012 14:01:15 +0000 (22:01 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 15 Oct 2012 07:09:27 +0000 (09:09 +0200)
In case of error, the function pinctrl_register() returns
NULL not ERR_PTR(). The PTR_ERR() in the return value
should be replaced with error no.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-bcm2835.c

index 956d585309b3012d3c2e627557494ae3640a6b55..7e9be18ec2d2b92922373f7f62d8543d43febf50 100644 (file)
@@ -1031,7 +1031,7 @@ static int __devinit bcm2835_pinctrl_probe(struct platform_device *pdev)
        pc->pctl_dev = pinctrl_register(&bcm2835_pinctrl_desc, dev, pc);
        if (!pc->pctl_dev) {
                gpiochip_remove(&pc->gpio_chip);
-               return PTR_ERR(pc->pctl_dev);
+               return -EINVAL;
        }
 
        pc->gpio_range = bcm2835_pinctrl_gpio_range;