pinctrl: berlin: fix an error code in berlin_pinctrl_probe()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 11 Jun 2014 08:15:13 +0000 (11:15 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 4 Jul 2014 23:15:35 +0000 (01:15 +0200)
We are returning success here because PTR_ERR(NULL) is zero.  We should
be returning -ENODEV.

Fixes: 3de68d331c24 ('pinctrl: berlin: add the core pinctrl driver for Marvell Berlin SoCs')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/berlin/berlin.c

index edf5d2f..86db223 100644 (file)
@@ -320,7 +320,7 @@ int berlin_pinctrl_probe(struct platform_device *pdev,
 
        regmap = dev_get_regmap(&pdev->dev, NULL);
        if (!regmap)
-               return PTR_ERR(regmap);
+               return -ENODEV;
 
        pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);
        if (!pctrl)