Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: msm: Use devm_pinctrl_register() for pinctrl registration

Use devm_pinctrl_register() for pin control registration and clean
the error path.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Laxman Dewangan and committed by
Linus Walleij
fe0267f4 5f5e111a

+3 -5
+3 -5
drivers/pinctrl/qcom/pinctrl-msm.c
··· 898 898 msm_pinctrl_desc.name = dev_name(&pdev->dev); 899 899 msm_pinctrl_desc.pins = pctrl->soc->pins; 900 900 msm_pinctrl_desc.npins = pctrl->soc->npins; 901 - pctrl->pctrl = pinctrl_register(&msm_pinctrl_desc, &pdev->dev, pctrl); 901 + pctrl->pctrl = devm_pinctrl_register(&pdev->dev, &msm_pinctrl_desc, 902 + pctrl); 902 903 if (IS_ERR(pctrl->pctrl)) { 903 904 dev_err(&pdev->dev, "Couldn't register pinctrl driver\n"); 904 905 return PTR_ERR(pctrl->pctrl); 905 906 } 906 907 907 908 ret = msm_gpio_init(pctrl); 908 - if (ret) { 909 - pinctrl_unregister(pctrl->pctrl); 909 + if (ret) 910 910 return ret; 911 - } 912 911 913 912 platform_set_drvdata(pdev, pctrl); 914 913 ··· 922 923 struct msm_pinctrl *pctrl = platform_get_drvdata(pdev); 923 924 924 925 gpiochip_remove(&pctrl->chip); 925 - pinctrl_unregister(pctrl->pctrl); 926 926 927 927 unregister_restart_handler(&pctrl->restart_nb); 928 928