pinctrl: rockchip: Parse pin groups before calling pinctrl_register()
authorDoug Anderson <dianders@chromium.org>
Tue, 21 Oct 2014 17:47:34 +0000 (10:47 -0700)
committerHeiko Stuebner <heiko@sntech.de>
Wed, 29 Oct 2014 20:06:28 +0000 (21:06 +0100)
Just like in (529301c pinctrl: samsung: Parse pin groups before
calling pinctrl_register()), Rockchip also needs to parse pin groups
earlier to make hogs work.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Tested-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
drivers/pinctrl/pinctrl-rockchip.c

index 8a3c582108c5f225c8b72bd5c17e0b8e6e58a817..6c14f6c9c45583420328fc2c83e752f8533e988b 100644 (file)
@@ -1262,6 +1262,10 @@ static int rockchip_pinctrl_register(struct platform_device *pdev,
                }
        }
 
+       ret = rockchip_pinctrl_parse_dt(pdev, info);
+       if (ret)
+               return ret;
+
        info->pctl_dev = pinctrl_register(ctrldesc, &pdev->dev, info);
        if (!info->pctl_dev) {
                dev_err(&pdev->dev, "could not register pinctrl driver\n");
@@ -1279,12 +1283,6 @@ static int rockchip_pinctrl_register(struct platform_device *pdev,
                pinctrl_add_gpio_range(info->pctl_dev, &pin_bank->grange);
        }
 
-       ret = rockchip_pinctrl_parse_dt(pdev, info);
-       if (ret) {
-               pinctrl_unregister(info->pctl_dev);
-               return ret;
-       }
-
        return 0;
 }