diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2012-12-21 04:44:00 -0500 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2013-02-01 20:47:05 -0500 |
commit | 8a66a579083a20172a46e74d175a57621dccae0a (patch) | |
tree | e86f30b35852a0237ad64b7eed227f5edada1aa8 /drivers/leds/leds-pwm.c | |
parent | 261a5edd3ac77ecb4b33310a1dd1ed8d656f0569 (diff) |
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 <peter.ujfalusi@ti.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers/leds/leds-pwm.c')
-rw-r--r-- | drivers/leds/leds-pwm.c | 6 |
1 files changed, 2 insertions, 4 deletions
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) | |||
104 | return 0; | 104 | return 0; |
105 | 105 | ||
106 | err: | 106 | err: |
107 | if (i > 0) { | 107 | while (i--) |
108 | for (i = i - 1; i >= 0; i--) | 108 | led_classdev_unregister(&priv->leds[i].cdev); |
109 | led_classdev_unregister(&priv->leds[i].cdev); | ||
110 | } | ||
111 | 109 | ||
112 | return ret; | 110 | return ret; |
113 | } | 111 | } |