[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fccabf34-d5a7-e176-f8a8-cb9657d36450@broadcom.com>
Date: Wed, 24 Feb 2016 10:29:52 -0800
From: Ray Jui <ray.jui@...adcom.com>
To: Laxman Dewangan <ldewangan@...dia.com>, linus.walleij@...aro.org,
corbet@....net, lee@...nel.org
Cc: linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org, linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
bcm-kernel-feedback-list@...adcom.com,
linux-mediatek@...ts.infradead.org, Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
Jon Mason <jonmason@...adcom.com>
Subject: Re: [PATCH 06/50] pinctrl: iproc-gpio: Use devm_pinctrl_register()
for pinctrl registration
On 2/24/2016 5:15 AM, Laxman Dewangan wrote:
> Use devm_pinctrl_register() for pin control registration and clean
> the error path.
>
> Signed-off-by: Laxman Dewangan <ldewangan@...dia.com>
> Cc: Ray Jui <rjui@...adcom.com>
> Cc: Scott Branden <sbranden@...adcom.com>
> Cc: Jon Mason <jonmason@...adcom.com>
> ---
> drivers/pinctrl/bcm/pinctrl-iproc-gpio.c | 12 ++----------
> 1 file changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
> index d530ab4..e753af3 100644
> --- a/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
> +++ b/drivers/pinctrl/bcm/pinctrl-iproc-gpio.c
> @@ -623,7 +623,7 @@ static int iproc_gpio_register_pinconf(struct iproc_gpio *chip)
> pctldesc->npins = gc->ngpio;
> pctldesc->confops = &iproc_pconf_ops;
>
> - chip->pctl = pinctrl_register(pctldesc, chip->dev, chip);
> + chip->pctl = devm_pinctrl_register(chip->dev, pctldesc, chip);
> if (IS_ERR(chip->pctl)) {
> dev_err(chip->dev, "unable to register pinctrl device\n");
> return PTR_ERR(chip->pctl);
> @@ -632,11 +632,6 @@ static int iproc_gpio_register_pinconf(struct iproc_gpio *chip)
> return 0;
> }
>
> -static void iproc_gpio_unregister_pinconf(struct iproc_gpio *chip)
> -{
> - pinctrl_unregister(chip->pctl);
> -}
> -
> static const struct of_device_id iproc_gpio_of_match[] = {
> { .compatible = "brcm,cygnus-ccm-gpio" },
> { .compatible = "brcm,cygnus-asiu-gpio" },
> @@ -720,7 +715,7 @@ static int iproc_gpio_probe(struct platform_device *pdev)
> handle_simple_irq, IRQ_TYPE_NONE);
> if (ret) {
> dev_err(dev, "no GPIO irqchip\n");
> - goto err_unregister_pinconf;
> + goto err_rm_gpiochip;
> }
>
> gpiochip_set_chained_irqchip(gc, &iproc_gpio_irq_chip, irq,
> @@ -729,9 +724,6 @@ static int iproc_gpio_probe(struct platform_device *pdev)
>
> return 0;
>
> -err_unregister_pinconf:
> - iproc_gpio_unregister_pinconf(chip);
> -
> err_rm_gpiochip:
> gpiochip_remove(gc);
>
>
Acked-by: Ray Jui <ray.jui@...adcom.com>
Thanks!
Ray
Powered by blists - more mailing lists