|
@@ -729,7 +729,7 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
|
|
pctrl->desc.custom_conf_items = pm8xxx_conf_items;
|
|
pctrl->desc.custom_conf_items = pm8xxx_conf_items;
|
|
#endif
|
|
#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)) {
|
|
if (IS_ERR(pctrl->pctrl)) {
|
|
dev_err(&pdev->dev, "couldn't register pm8xxx gpio driver\n");
|
|
dev_err(&pdev->dev, "couldn't register pm8xxx gpio driver\n");
|
|
return PTR_ERR(pctrl->pctrl);
|
|
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);
|
|
ret = gpiochip_add_data(&pctrl->chip, pctrl);
|
|
if (ret) {
|
|
if (ret) {
|
|
dev_err(&pdev->dev, "failed register gpiochip\n");
|
|
dev_err(&pdev->dev, "failed register gpiochip\n");
|
|
- goto unregister_pinctrl;
|
|
|
|
|
|
+ return ret;
|
|
}
|
|
}
|
|
|
|
|
|
ret = gpiochip_add_pin_range(&pctrl->chip,
|
|
ret = gpiochip_add_pin_range(&pctrl->chip,
|
|
@@ -765,9 +765,6 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
|
|
unregister_gpiochip:
|
|
unregister_gpiochip:
|
|
gpiochip_remove(&pctrl->chip);
|
|
gpiochip_remove(&pctrl->chip);
|
|
|
|
|
|
-unregister_pinctrl:
|
|
|
|
- pinctrl_unregister(pctrl->pctrl);
|
|
|
|
-
|
|
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -777,8 +774,6 @@ static int pm8xxx_gpio_remove(struct platform_device *pdev)
|
|
|
|
|
|
gpiochip_remove(&pctrl->chip);
|
|
gpiochip_remove(&pctrl->chip);
|
|
|
|
|
|
- pinctrl_unregister(pctrl->pctrl);
|
|
|
|
-
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|