From 8a66a579083a20172a46e74d175a57621dccae0a Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Fri, 21 Dec 2012 01:44:00 -0800 Subject: leds: leds-pwm: Simplify cleanup code The code looks more nicer if we use: while (i--) instead: if (i > 0) for (i = i - 1; i >= 0; i--) Signed-off-by: Peter Ujfalusi Signed-off-by: Bryan Wu --- drivers/leds/leds-pwm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c index c767837522fe..46f4e44c6c6d 100644 --- a/drivers/leds/leds-pwm.c +++ b/drivers/leds/leds-pwm.c @@ -104,10 +104,8 @@ static int led_pwm_probe(struct platform_device *pdev) return 0; err: - if (i > 0) { - for (i = i - 1; i >= 0; i--) - led_classdev_unregister(&priv->leds[i].cdev); - } + while (i--) + led_classdev_unregister(&priv->leds[i].cdev); return ret; } -- cgit v1.2.3-70-g09d2