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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <55DEBBBD.9010802@samsung.com>
Date:	Thu, 27 Aug 2015 09:26:53 +0200
From:	Jacek Anaszewski <j.anaszewski@...sung.com>
To:	Vaishali Thakkar <vthakkar1994@...il.com>
Cc:	Richard Purdie <rpurdie@...ys.net>, linux-leds@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] leds: leds-cobalt-qube: Use devm_led_classdev_register

Hi Vaishali,

Thanks for the patch.

On 08/27/2015 07:13 AM, Vaishali Thakkar wrote:
> Use resource-managed function devm_led_classdev_register instead
> of led_classdev_register to make the error-path simpler.
>
> To be compatible with the change, goto is replaced with direct
> return and unneeded label is dropped. Also, remove redundant
> cobalt_qube_led_remove.
>
> Signed-off-by: Vaishali Thakkar <vthakkar1994@...il.com>
> ---
>   drivers/leds/leds-cobalt-qube.c | 20 ++------------------
>   1 file changed, 2 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/leds/leds-cobalt-qube.c b/drivers/leds/leds-cobalt-qube.c
> index d975220..59818df 100644
> --- a/drivers/leds/leds-cobalt-qube.c
> +++ b/drivers/leds/leds-cobalt-qube.c
> @@ -49,31 +49,15 @@ static int cobalt_qube_led_probe(struct platform_device *pdev)
>   	led_value = LED_FRONT_LEFT | LED_FRONT_RIGHT;
>   	writeb(led_value, led_port);
>
> -	retval = led_classdev_register(&pdev->dev, &qube_front_led);
> +	retval = devm_led_classdev_register(&pdev->dev, &qube_front_led);
>   	if (retval)
> -		goto err_null;

We can spare more lines by changing this to:

return devm_led_classdev_register(&pdev->dev, &qube_front_led);

You could get rid of retval then, too.

> -
> -	return 0;
> -
> -err_null:
> -	led_port = NULL;
> -
> -	return retval;
> -}
> -
> -static int cobalt_qube_led_remove(struct platform_device *pdev)
> -{
> -	led_classdev_unregister(&qube_front_led);
> -
> -	if (led_port)
> -		led_port = NULL;
> +		return retval;
>
>   	return 0;
>   }
>
>   static struct platform_driver cobalt_qube_led_driver = {
>   	.probe	= cobalt_qube_led_probe,
> -	.remove	= cobalt_qube_led_remove,
>   	.driver	= {
>   		.name	= "cobalt-qube-leds",
>   	},
>


-- 
Best Regards,
Jacek Anaszewski
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ