pinctrl: xway: use devm_gpiochip_add_data()
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 23 May 2016 09:00:37 +0000 (11:00 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 7 Jun 2016 07:37:21 +0000 (09:37 +0200)
Avoid a gpiochip_free() and use standard functions.

Cc: John Crispin <blogic@openwrt.org>
Cc: Pramod Gurav <pramod.gurav@smartplayin.com>
Cc: Martin Schiller <mschiller@tdt.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-xway.c

index a13f2b6f6fc0b4572a61d889922498027accfd49..b9375544dff0be4432ff64eea5846780b1c6b05d 100644 (file)
@@ -1724,9 +1724,9 @@ static int pinmux_xway_probe(struct platform_device *pdev)
        }
        xway_pctrl_desc.pins = xway_info.pads;
 
-       /* load the gpio chip */
+       /* register the gpio chip */
        xway_chip.parent = &pdev->dev;
-       ret = gpiochip_add(&xway_chip);
+       ret = devm_gpiochip_add_data(&pdev->dev, &xway_chip, NULL);
        if (ret) {
                dev_err(&pdev->dev, "Failed to register gpio chip\n");
                return ret;
@@ -1749,7 +1749,6 @@ static int pinmux_xway_probe(struct platform_device *pdev)
        /* register with the generic lantiq layer */
        ret = ltq_pinctrl_register(pdev, &xway_info);
        if (ret) {
-               gpiochip_remove(&xway_chip);
                dev_err(&pdev->dev, "Failed to register pinctrl driver\n");
                return ret;
        }
This page took 0.026367 seconds and 5 git commands to generate.