pinctrl/amd: Drop pinctrl_unregister for devm_ registered device
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 17 Jan 2017 15:55:32 +0000 (15:55 +0000)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 18 Jan 2017 23:15:09 +0000 (00:15 +0100)
It's not necessary to unregister pin controller device registered
with devm_pinctrl_register() and using pinctrl_unregister() leads
to a double free.

Fixes: 3bfd44306c65 ("pinctrl: amd: Add support for additional GPIO")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-amd.c

index 1ee107f147d04f891c96495103cbb5f268dc4fe6..6b75bd2b71db38136fa80008817139c7250ea3a4 100644 (file)
@@ -836,7 +836,6 @@ static int amd_gpio_remove(struct platform_device *pdev)
        gpio_dev = platform_get_drvdata(pdev);
 
        gpiochip_remove(&gpio_dev->gc);
-       pinctrl_unregister(gpio_dev->pctrl);
 
        return 0;
 }