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>
This commit is contained in:
Peter Ujfalusi 2012-12-21 01:44:00 -08:00 committed by Bryan Wu
parent 261a5edd3a
commit 8a66a57908

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