diff options
Diffstat (limited to 'drivers/pinctrl/intel/pinctrl-intel.c')
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-intel.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index 6c2c816f8e5f..3584e50fa2c6 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -1045,17 +1045,16 @@ int intel_pinctrl_probe(struct platform_device *pdev, pctrl->pctldesc.pins = pctrl->soc->pins; pctrl->pctldesc.npins = pctrl->soc->npins; - pctrl->pctldev = pinctrl_register(&pctrl->pctldesc, &pdev->dev, pctrl); + pctrl->pctldev = devm_pinctrl_register(&pdev->dev, &pctrl->pctldesc, + pctrl); if (IS_ERR(pctrl->pctldev)) { dev_err(&pdev->dev, "failed to register pinctrl driver\n"); return PTR_ERR(pctrl->pctldev); } ret = intel_gpio_probe(pctrl, irq); - if (ret) { - pinctrl_unregister(pctrl->pctldev); + if (ret) return ret; - } platform_set_drvdata(pdev, pctrl); @@ -1068,7 +1067,6 @@ int intel_pinctrl_remove(struct platform_device *pdev) struct intel_pinctrl *pctrl = platform_get_drvdata(pdev); gpiochip_remove(&pctrl->chip); - pinctrl_unregister(pctrl->pctldev); return 0; } |