Commit 8a66a579 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Bryan Wu

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: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarBryan Wu <cooloney@gmail.com>
parent 261a5edd
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment