pinctrl: bcm2835: Use devm_pinctrl_register() for pinctrl registration
authorLaxman Dewangan <ldewangan@nvidia.com>
Wed, 24 Feb 2016 09:14:07 +0000 (14:44 +0530)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 20 Apr 2016 22:01:56 +0000 (00:01 +0200)
Use devm_pinctrl_register() for pin control registration.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Ray Jui <rjui@broadcom.com>
Cc: linux-rpi-kernel@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: bcm-kernel-feedback-list@broadcom.com
Acked-by: Ray Jui <ray.jui@broadcom.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/bcm/pinctrl-bcm2835.c

index 57e7d21d526bfa57c5fe49882b35f050231c86a3..fa77165fab2c1348163979da507df17e7168c49b 100644 (file)
@@ -1040,7 +1040,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
                return err;
        }
 
-       pc->pctl_dev = pinctrl_register(&bcm2835_pinctrl_desc, dev, pc);
+       pc->pctl_dev = devm_pinctrl_register(dev, &bcm2835_pinctrl_desc, pc);
        if (IS_ERR(pc->pctl_dev)) {
                gpiochip_remove(&pc->gpio_chip);
                return PTR_ERR(pc->pctl_dev);
@@ -1058,7 +1058,6 @@ static int bcm2835_pinctrl_remove(struct platform_device *pdev)
 {
        struct bcm2835_pinctrl *pc = platform_get_drvdata(pdev);
 
-       pinctrl_unregister(pc->pctl_dev);
        gpiochip_remove(&pc->gpio_chip);
 
        return 0;