lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160224134219.GI2225@tarshish>
Date:	Wed, 24 Feb 2016 15:42:19 +0200
From:	Baruch Siach <baruch@...s.co.il>
To:	Laxman Dewangan <ldewangan@...dia.com>
Cc:	linus.walleij@...aro.org, corbet@....net, lee@...nel.org,
	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
Subject: Re: [PATCH 38/50] pinctrl: digicolor: Use devm_pinctrl_register()
 for pinctrl registration

Hi Laxman Dewangan,

On Wed, Feb 24, 2016 at 06:46:03PM +0530, Laxman Dewangan wrote:
> Use devm_pinctrl_register() for pin control registration and clean
> error path.
> 
> Signed-off-by: Laxman Dewangan <ldewangan@...dia.com>
> Cc: Baruch Siach <baruch@...s.co.il>
> ---
>  drivers/pinctrl/pinctrl-digicolor.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-digicolor.c b/drivers/pinctrl/pinctrl-digicolor.c
> index f1343d6..c18014d 100644
> --- a/drivers/pinctrl/pinctrl-digicolor.c
> +++ b/drivers/pinctrl/pinctrl-digicolor.c
> @@ -326,17 +326,15 @@ static int dc_pinctrl_probe(struct platform_device *pdev)
>  
>  	pmap->dev = &pdev->dev;
>  
> -	pmap->pctl = pinctrl_register(pctl_desc, &pdev->dev, pmap);
> +	pmap->pctl = devm_pinctrl_register(&pdev->dev, pctl_desc, pmap);
>  	if (IS_ERR(pmap->pctl)) {
>  		dev_err(&pdev->dev, "pinctrl driver registration failed\n");
>  		return PTR_ERR(pmap->pctl);
>  	}
>  
>  	ret = dc_gpiochip_add(pmap, pdev->dev.of_node);
> -	if (ret < 0) {
> -		pinctrl_unregister(pmap->pctl);
> +	if (ret < 0)
>  		return ret;
> -	}
>  
>  	return 0;

Please simplify even more to just:

   return dc_gpiochip_add(pmap, pdev->dev.of_node);

and remove the no longer used 'ret' variable.

Thanks,
baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@...s.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ