1
0
Fork 0

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>
hifive-unleashed-5.1
Peter Ujfalusi 2012-12-21 01:44:00 -08:00 committed by Bryan Wu
parent 261a5edd3a
commit 8a66a57908
1 changed files with 2 additions and 4 deletions

View File

@ -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;
}