projects
/
GitHub
/
MotorolaMobilityLLC
/
kernel-slsi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
261a5ed
)
leds: leds-pwm: Simplify cleanup code
author
Peter Ujfalusi
<peter.ujfalusi@ti.com>
Fri, 21 Dec 2012 09:44:00 +0000
(
01:44
-0800)
committer
Bryan Wu
<cooloney@gmail.com>
Sat, 2 Feb 2013 01:47:05 +0000
(17:47 -0800)
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>
drivers/leds/leds-pwm.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/leds/leds-pwm.c
b/drivers/leds/leds-pwm.c
index c767837522fe15a92b01d3157dd0c2832eb93cad..46f4e44c6c6d3b2e445622c98cca2bed25f8f57f 100644
(file)
--- 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)
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;
}