diff options
author | ZHAO Gang <gamerh2o@gmail.com> | 2013-12-28 07:00:26 -0800 |
---|---|---|
committer | Bryan Wu <cooloney@gmail.com> | 2014-01-27 17:28:52 -0800 |
commit | 11e043b53c3d4fbcbf91761b8dfd885da6fc8eff (patch) | |
tree | d72b9fcfebe3c44166983b76ee8ebe998b9e0fb7 /drivers/leds/led-triggers.c | |
parent | 00d195528547f31ac329aa36dc385b13fdc58f11 (diff) |
leds: replace list_for_each with list_for_each_entry
Use the more convenient macro.
Signed-off-by: ZHAO Gang <gamerh2o@gmail.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers/leds/led-triggers.c')
-rw-r--r-- | drivers/leds/led-triggers.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c index 3c972b2f9893..e387f41a9cb7 100644 --- a/drivers/leds/led-triggers.c +++ b/drivers/leds/led-triggers.c @@ -242,18 +242,14 @@ EXPORT_SYMBOL_GPL(led_trigger_unregister); void led_trigger_event(struct led_trigger *trig, enum led_brightness brightness) { - struct list_head *entry; + struct led_classdev *led_cdev; if (!trig) return; read_lock(&trig->leddev_list_lock); - list_for_each(entry, &trig->led_cdevs) { - struct led_classdev *led_cdev; - - led_cdev = list_entry(entry, struct led_classdev, trig_list); + list_for_each_entry(led_cdev, &trig->led_cdevs, trig_list) led_set_brightness(led_cdev, brightness); - } read_unlock(&trig->leddev_list_lock); } EXPORT_SYMBOL_GPL(led_trigger_event); @@ -264,16 +260,13 @@ static void led_trigger_blink_setup(struct led_trigger *trig, int oneshot, int invert) { - struct list_head *entry; + struct led_classdev *led_cdev; if (!trig) return; read_lock(&trig->leddev_list_lock); - list_for_each(entry, &trig->led_cdevs) { - struct led_classdev *led_cdev; - - led_cdev = list_entry(entry, struct led_classdev, trig_list); + list_for_each_entry(led_cdev, &trig->led_cdevs, trig_list) { if (oneshot) led_blink_set_oneshot(led_cdev, delay_on, delay_off, invert); |