mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-27 11:55:53 +00:00
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:
parent
261a5edd3a
commit
8a66a57908
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user