Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b120a3c2 authored by Wei Yongjun's avatar Wei Yongjun Committed by Linus Walleij
Browse files

pinctrl: pistachio: Drop pinctrl_unregister for devm_ registered device



It's not necessary to unregister pin controller device registered
with devm_pinctrl_register() and using pinctrl_unregister() leads
to a double free.

This is detected by Coccinelle semantic patch.

Signed-off-by: default avatarWei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 5b236d0f
Loading
Loading
Loading
Loading
+1 −8
Original line number Original line Diff line number Diff line
@@ -1432,7 +1432,6 @@ static int pistachio_pinctrl_probe(struct platform_device *pdev)
{
{
	struct pistachio_pinctrl *pctl;
	struct pistachio_pinctrl *pctl;
	struct resource *res;
	struct resource *res;
	int ret;


	pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL);
	pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL);
	if (!pctl)
	if (!pctl)
@@ -1464,13 +1463,7 @@ static int pistachio_pinctrl_probe(struct platform_device *pdev)
		return PTR_ERR(pctl->pctldev);
		return PTR_ERR(pctl->pctldev);
	}
	}


	ret = pistachio_gpio_register(pctl);
	return pistachio_gpio_register(pctl);
	if (ret < 0) {
		pinctrl_unregister(pctl->pctldev);
		return ret;
	}

	return 0;
}
}


static struct platform_driver pistachio_pinctrl_driver = {
static struct platform_driver pistachio_pinctrl_driver = {