diff options
Diffstat (limited to 'drivers/pinctrl/qcom')
-rw-r--r-- | drivers/pinctrl/qcom/pinctrl-msm.c | 10 | ||||
-rw-r--r-- | drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 9 | ||||
-rw-r--r-- | drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 9 | ||||
-rw-r--r-- | drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 11 | ||||
-rw-r--r-- | drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c | 11 |
5 files changed, 16 insertions, 34 deletions
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c index 8777cf083..1a44e1d03 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -101,7 +101,7 @@ static const struct pinctrl_ops msm_pinctrl_ops = { .get_group_name = msm_get_group_name, .get_group_pins = msm_get_group_pins, .dt_node_to_map = pinconf_generic_dt_node_to_map_group, - .dt_free_map = pinctrl_utils_dt_free_map, + .dt_free_map = pinctrl_utils_free_map, }; static int msm_get_functions_count(struct pinctrl_dev *pctldev) @@ -898,17 +898,16 @@ int msm_pinctrl_probe(struct platform_device *pdev, msm_pinctrl_desc.name = dev_name(&pdev->dev); msm_pinctrl_desc.pins = pctrl->soc->pins; msm_pinctrl_desc.npins = pctrl->soc->npins; - pctrl->pctrl = pinctrl_register(&msm_pinctrl_desc, &pdev->dev, pctrl); + pctrl->pctrl = devm_pinctrl_register(&pdev->dev, &msm_pinctrl_desc, + pctrl); if (IS_ERR(pctrl->pctrl)) { dev_err(&pdev->dev, "Couldn't register pinctrl driver\n"); return PTR_ERR(pctrl->pctrl); } ret = msm_gpio_init(pctrl); - if (ret) { - pinctrl_unregister(pctrl->pctrl); + if (ret) return ret; - } platform_set_drvdata(pdev, pctrl); @@ -923,7 +922,6 @@ int msm_pinctrl_remove(struct platform_device *pdev) struct msm_pinctrl *pctrl = platform_get_drvdata(pdev); gpiochip_remove(&pctrl->chip); - pinctrl_unregister(pctrl->pctrl); unregister_restart_handler(&pctrl->restart_nb); diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c index 4e12ded3c..686accb89 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c @@ -212,7 +212,7 @@ static const struct pinctrl_ops pmic_gpio_pinctrl_ops = { .get_group_name = pmic_gpio_get_group_name, .get_group_pins = pmic_gpio_get_group_pins, .dt_node_to_map = pinconf_generic_dt_node_to_map_group, - .dt_free_map = pinctrl_utils_dt_free_map, + .dt_free_map = pinctrl_utils_free_map, }; static int pmic_gpio_get_functions_count(struct pinctrl_dev *pctldev) @@ -764,14 +764,14 @@ static int pmic_gpio_probe(struct platform_device *pdev) state->chip.of_gpio_n_cells = 2; state->chip.can_sleep = false; - state->ctrl = pinctrl_register(pctrldesc, dev, state); + state->ctrl = devm_pinctrl_register(dev, pctrldesc, state); if (IS_ERR(state->ctrl)) return PTR_ERR(state->ctrl); ret = gpiochip_add_data(&state->chip, state); if (ret) { dev_err(state->dev, "can't add gpio chip\n"); - goto err_chip; + return ret; } ret = gpiochip_add_pin_range(&state->chip, dev_name(dev), 0, 0, npins); @@ -784,8 +784,6 @@ static int pmic_gpio_probe(struct platform_device *pdev) err_range: gpiochip_remove(&state->chip); -err_chip: - pinctrl_unregister(state->ctrl); return ret; } @@ -794,7 +792,6 @@ static int pmic_gpio_remove(struct platform_device *pdev) struct pmic_gpio_state *state = platform_get_drvdata(pdev); gpiochip_remove(&state->chip); - pinctrl_unregister(state->ctrl); return 0; } diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c index 2a3e5490a..1735ffef9 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c @@ -235,7 +235,7 @@ static const struct pinctrl_ops pmic_mpp_pinctrl_ops = { .get_group_name = pmic_mpp_get_group_name, .get_group_pins = pmic_mpp_get_group_pins, .dt_node_to_map = pinconf_generic_dt_node_to_map_group, - .dt_free_map = pinctrl_utils_dt_free_map, + .dt_free_map = pinctrl_utils_free_map, }; static int pmic_mpp_get_functions_count(struct pinctrl_dev *pctldev) @@ -877,14 +877,14 @@ static int pmic_mpp_probe(struct platform_device *pdev) state->chip.of_gpio_n_cells = 2; state->chip.can_sleep = false; - state->ctrl = pinctrl_register(pctrldesc, dev, state); + state->ctrl = devm_pinctrl_register(dev, pctrldesc, state); if (IS_ERR(state->ctrl)) return PTR_ERR(state->ctrl); ret = gpiochip_add_data(&state->chip, state); if (ret) { dev_err(state->dev, "can't add gpio chip\n"); - goto err_chip; + return ret; } ret = gpiochip_add_pin_range(&state->chip, dev_name(dev), 0, 0, npins); @@ -897,8 +897,6 @@ static int pmic_mpp_probe(struct platform_device *pdev) err_range: gpiochip_remove(&state->chip); -err_chip: - pinctrl_unregister(state->ctrl); return ret; } @@ -907,7 +905,6 @@ static int pmic_mpp_remove(struct platform_device *pdev) struct pmic_mpp_state *state = platform_get_drvdata(pdev); gpiochip_remove(&state->chip); - pinctrl_unregister(state->ctrl); return 0; } diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c index cd8580d97..d3f5501d1 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c @@ -200,7 +200,7 @@ static const struct pinctrl_ops pm8xxx_pinctrl_ops = { .get_group_name = pm8xxx_get_group_name, .get_group_pins = pm8xxx_get_group_pins, .dt_node_to_map = pinconf_generic_dt_node_to_map_group, - .dt_free_map = pinctrl_utils_dt_free_map, + .dt_free_map = pinctrl_utils_free_map, }; static int pm8xxx_get_functions_count(struct pinctrl_dev *pctldev) @@ -729,7 +729,7 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev) pctrl->desc.custom_conf_items = pm8xxx_conf_items; #endif - pctrl->pctrl = pinctrl_register(&pctrl->desc, &pdev->dev, pctrl); + pctrl->pctrl = devm_pinctrl_register(&pdev->dev, &pctrl->desc, pctrl); if (IS_ERR(pctrl->pctrl)) { dev_err(&pdev->dev, "couldn't register pm8xxx gpio driver\n"); return PTR_ERR(pctrl->pctrl); @@ -745,7 +745,7 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev) ret = gpiochip_add_data(&pctrl->chip, pctrl); if (ret) { dev_err(&pdev->dev, "failed register gpiochip\n"); - goto unregister_pinctrl; + return ret; } ret = gpiochip_add_pin_range(&pctrl->chip, @@ -765,9 +765,6 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev) unregister_gpiochip: gpiochip_remove(&pctrl->chip); -unregister_pinctrl: - pinctrl_unregister(pctrl->pctrl); - return ret; } @@ -777,8 +774,6 @@ static int pm8xxx_gpio_remove(struct platform_device *pdev) gpiochip_remove(&pctrl->chip); - pinctrl_unregister(pctrl->pctrl); - return 0; } diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c index 54a5402a9..9191727af 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c @@ -277,7 +277,7 @@ static const struct pinctrl_ops pm8xxx_pinctrl_ops = { .get_group_name = pm8xxx_get_group_name, .get_group_pins = pm8xxx_get_group_pins, .dt_node_to_map = pinconf_generic_dt_node_to_map_group, - .dt_free_map = pinctrl_utils_dt_free_map, + .dt_free_map = pinctrl_utils_free_map, }; static int pm8xxx_get_functions_count(struct pinctrl_dev *pctldev) @@ -820,7 +820,7 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev) pctrl->desc.custom_conf_items = pm8xxx_conf_items; #endif - pctrl->pctrl = pinctrl_register(&pctrl->desc, &pdev->dev, pctrl); + pctrl->pctrl = devm_pinctrl_register(&pdev->dev, &pctrl->desc, pctrl); if (IS_ERR(pctrl->pctrl)) { dev_err(&pdev->dev, "couldn't register pm8xxx mpp driver\n"); return PTR_ERR(pctrl->pctrl); @@ -836,7 +836,7 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev) ret = gpiochip_add_data(&pctrl->chip, pctrl); if (ret) { dev_err(&pdev->dev, "failed register gpiochip\n"); - goto unregister_pinctrl; + return ret; } ret = gpiochip_add_pin_range(&pctrl->chip, @@ -856,9 +856,6 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev) unregister_gpiochip: gpiochip_remove(&pctrl->chip); -unregister_pinctrl: - pinctrl_unregister(pctrl->pctrl); - return ret; } @@ -868,8 +865,6 @@ static int pm8xxx_mpp_remove(struct platform_device *pdev) gpiochip_remove(&pctrl->chip); - pinctrl_unregister(pctrl->pctrl); - return 0; } |