aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorShuah Khan <shuahkhan@gmail.com>2012-06-12 22:01:37 -0400
committerBryan Wu <bryan.wu@canonical.com>2012-07-23 19:52:34 -0400
commit0da3e65ba892b8c63d55fa5ec197b6fae55f75f8 (patch)
tree2df9324b199abaa542854297611e0c815517f51f /drivers/leds
parent5e417281cde2ef56e9eb1a95d080d6254402e794 (diff)
leds: Rename led_set_brightness() to __led_set_brightness()
Rename leds internal interface led_set_brightness() to __led_set_brightness() to reduce confusion between led_set_brightness() and the external interface led_brightness_set(). led_brightness_set() cancels the timer and then calls led_set_brightness(). Signed-off-by: Shuah Khan <shuahkhan@gmail.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/led-class.c6
-rw-r--r--drivers/leds/led-core.c4
-rw-r--r--drivers/leds/led-triggers.c2
-rw-r--r--drivers/leds/leds.h2
-rw-r--r--drivers/leds/ledtrig-backlight.c8
-rw-r--r--drivers/leds/ledtrig-default-on.c2
-rw-r--r--drivers/leds/ledtrig-gpio.c6
-rw-r--r--drivers/leds/ledtrig-heartbeat.c2
-rw-r--r--drivers/leds/ledtrig-oneshot.c4
-rw-r--r--drivers/leds/ledtrig-transient.c8
10 files changed, 22 insertions, 22 deletions
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 81eb0916b44a..cb0a6eb72a2c 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -53,7 +53,7 @@ static ssize_t led_brightness_store(struct device *dev,
53 53
54 if (state == LED_OFF) 54 if (state == LED_OFF)
55 led_trigger_remove(led_cdev); 55 led_trigger_remove(led_cdev);
56 led_set_brightness(led_cdev, state); 56 __led_set_brightness(led_cdev, state);
57 57
58 return size; 58 return size;
59} 59}
@@ -82,7 +82,7 @@ static void led_timer_function(unsigned long data)
82 unsigned long delay; 82 unsigned long delay;
83 83
84 if (!led_cdev->blink_delay_on || !led_cdev->blink_delay_off) { 84 if (!led_cdev->blink_delay_on || !led_cdev->blink_delay_off) {
85 led_set_brightness(led_cdev, LED_OFF); 85 __led_set_brightness(led_cdev, LED_OFF);
86 return; 86 return;
87 } 87 }
88 88
@@ -105,7 +105,7 @@ static void led_timer_function(unsigned long data)
105 delay = led_cdev->blink_delay_off; 105 delay = led_cdev->blink_delay_off;
106 } 106 }
107 107
108 led_set_brightness(led_cdev, brightness); 108 __led_set_brightness(led_cdev, brightness);
109 109
110 /* Return in next iteration if led is in one-shot mode and we are in 110 /* Return in next iteration if led is in one-shot mode and we are in
111 * the final blink state so that the led is toggled each delay_on + 111 * the final blink state so that the led is toggled each delay_on +
diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c
index 31f1f78ef40b..176961b2db6b 100644
--- a/drivers/leds/led-core.c
+++ b/drivers/leds/led-core.c
@@ -45,7 +45,7 @@ static void led_set_software_blink(struct led_classdev *led_cdev,
45 45
46 /* never off - just set to brightness */ 46 /* never off - just set to brightness */
47 if (!delay_off) { 47 if (!delay_off) {
48 led_set_brightness(led_cdev, led_cdev->blink_brightness); 48 __led_set_brightness(led_cdev, led_cdev->blink_brightness);
49 return; 49 return;
50 } 50 }
51 51
@@ -111,6 +111,6 @@ void led_brightness_set(struct led_classdev *led_cdev,
111 led_cdev->blink_delay_on = 0; 111 led_cdev->blink_delay_on = 0;
112 led_cdev->blink_delay_off = 0; 112 led_cdev->blink_delay_off = 0;
113 113
114 led_set_brightness(led_cdev, brightness); 114 __led_set_brightness(led_cdev, brightness);
115} 115}
116EXPORT_SYMBOL(led_brightness_set); 116EXPORT_SYMBOL(led_brightness_set);
diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
index fa0b9be019ea..f8b14dd8c2b6 100644
--- a/drivers/leds/led-triggers.c
+++ b/drivers/leds/led-triggers.c
@@ -224,7 +224,7 @@ void led_trigger_event(struct led_trigger *trig,
224 struct led_classdev *led_cdev; 224 struct led_classdev *led_cdev;
225 225
226 led_cdev = list_entry(entry, struct led_classdev, trig_list); 226 led_cdev = list_entry(entry, struct led_classdev, trig_list);
227 led_set_brightness(led_cdev, brightness); 227 __led_set_brightness(led_cdev, brightness);
228 } 228 }
229 read_unlock(&trig->leddev_list_lock); 229 read_unlock(&trig->leddev_list_lock);
230} 230}
diff --git a/drivers/leds/leds.h b/drivers/leds/leds.h
index e77c7f8dcdd4..d02acd496126 100644
--- a/drivers/leds/leds.h
+++ b/drivers/leds/leds.h
@@ -17,7 +17,7 @@
17#include <linux/rwsem.h> 17#include <linux/rwsem.h>
18#include <linux/leds.h> 18#include <linux/leds.h>
19 19
20static inline void led_set_brightness(struct led_classdev *led_cdev, 20static inline void __led_set_brightness(struct led_classdev *led_cdev,
21 enum led_brightness value) 21 enum led_brightness value)
22{ 22{
23 if (value > led_cdev->max_brightness) 23 if (value > led_cdev->max_brightness)
diff --git a/drivers/leds/ledtrig-backlight.c b/drivers/leds/ledtrig-backlight.c
index e2726867c5d4..b941685f2227 100644
--- a/drivers/leds/ledtrig-backlight.c
+++ b/drivers/leds/ledtrig-backlight.c
@@ -46,9 +46,9 @@ static int fb_notifier_callback(struct notifier_block *p,
46 46
47 if ((n->old_status == UNBLANK) ^ n->invert) { 47 if ((n->old_status == UNBLANK) ^ n->invert) {
48 n->brightness = led->brightness; 48 n->brightness = led->brightness;
49 led_set_brightness(led, LED_OFF); 49 __led_set_brightness(led, LED_OFF);
50 } else { 50 } else {
51 led_set_brightness(led, n->brightness); 51 __led_set_brightness(led, n->brightness);
52 } 52 }
53 53
54 n->old_status = new_status; 54 n->old_status = new_status;
@@ -87,9 +87,9 @@ static ssize_t bl_trig_invert_store(struct device *dev,
87 87
88 /* After inverting, we need to update the LED. */ 88 /* After inverting, we need to update the LED. */
89 if ((n->old_status == BLANK) ^ n->invert) 89 if ((n->old_status == BLANK) ^ n->invert)
90 led_set_brightness(led, LED_OFF); 90 __led_set_brightness(led, LED_OFF);
91 else 91 else
92 led_set_brightness(led, n->brightness); 92 __led_set_brightness(led, n->brightness);
93 93
94 return num; 94 return num;
95} 95}
diff --git a/drivers/leds/ledtrig-default-on.c b/drivers/leds/ledtrig-default-on.c
index a4ef54b9d508..eac1f1b1adac 100644
--- a/drivers/leds/ledtrig-default-on.c
+++ b/drivers/leds/ledtrig-default-on.c
@@ -19,7 +19,7 @@
19 19
20static void defon_trig_activate(struct led_classdev *led_cdev) 20static void defon_trig_activate(struct led_classdev *led_cdev)
21{ 21{
22 led_set_brightness(led_cdev, led_cdev->max_brightness); 22 __led_set_brightness(led_cdev, led_cdev->max_brightness);
23} 23}
24 24
25static struct led_trigger defon_led_trigger = { 25static struct led_trigger defon_led_trigger = {
diff --git a/drivers/leds/ledtrig-gpio.c b/drivers/leds/ledtrig-gpio.c
index f057c101b896..ba215dc42f98 100644
--- a/drivers/leds/ledtrig-gpio.c
+++ b/drivers/leds/ledtrig-gpio.c
@@ -54,12 +54,12 @@ static void gpio_trig_work(struct work_struct *work)
54 54
55 if (tmp) { 55 if (tmp) {
56 if (gpio_data->desired_brightness) 56 if (gpio_data->desired_brightness)
57 led_set_brightness(gpio_data->led, 57 __led_set_brightness(gpio_data->led,
58 gpio_data->desired_brightness); 58 gpio_data->desired_brightness);
59 else 59 else
60 led_set_brightness(gpio_data->led, LED_FULL); 60 __led_set_brightness(gpio_data->led, LED_FULL);
61 } else { 61 } else {
62 led_set_brightness(gpio_data->led, LED_OFF); 62 __led_set_brightness(gpio_data->led, LED_OFF);
63 } 63 }
64} 64}
65 65
diff --git a/drivers/leds/ledtrig-heartbeat.c b/drivers/leds/ledtrig-heartbeat.c
index a019fbb70880..1edc7463ce83 100644
--- a/drivers/leds/ledtrig-heartbeat.c
+++ b/drivers/leds/ledtrig-heartbeat.c
@@ -74,7 +74,7 @@ static void led_heartbeat_function(unsigned long data)
74 break; 74 break;
75 } 75 }
76 76
77 led_set_brightness(led_cdev, brightness); 77 __led_set_brightness(led_cdev, brightness);
78 mod_timer(&heartbeat_data->timer, jiffies + delay); 78 mod_timer(&heartbeat_data->timer, jiffies + delay);
79} 79}
80 80
diff --git a/drivers/leds/ledtrig-oneshot.c b/drivers/leds/ledtrig-oneshot.c
index 5c9edf7f489c..5cbab41a8da2 100644
--- a/drivers/leds/ledtrig-oneshot.c
+++ b/drivers/leds/ledtrig-oneshot.c
@@ -63,9 +63,9 @@ static ssize_t led_invert_store(struct device *dev,
63 oneshot_data->invert = !!state; 63 oneshot_data->invert = !!state;
64 64
65 if (oneshot_data->invert) 65 if (oneshot_data->invert)
66 led_set_brightness(led_cdev, LED_FULL); 66 __led_set_brightness(led_cdev, LED_FULL);
67 else 67 else
68 led_set_brightness(led_cdev, LED_OFF); 68 __led_set_brightness(led_cdev, LED_OFF);
69 69
70 return size; 70 return size;
71} 71}
diff --git a/drivers/leds/ledtrig-transient.c b/drivers/leds/ledtrig-transient.c
index 83179f435e1e..398f1042c43e 100644
--- a/drivers/leds/ledtrig-transient.c
+++ b/drivers/leds/ledtrig-transient.c
@@ -41,7 +41,7 @@ static void transient_timer_function(unsigned long data)
41 struct transient_trig_data *transient_data = led_cdev->trigger_data; 41 struct transient_trig_data *transient_data = led_cdev->trigger_data;
42 42
43 transient_data->activate = 0; 43 transient_data->activate = 0;
44 led_set_brightness(led_cdev, transient_data->restore_state); 44 __led_set_brightness(led_cdev, transient_data->restore_state);
45} 45}
46 46
47static ssize_t transient_activate_show(struct device *dev, 47static ssize_t transient_activate_show(struct device *dev,
@@ -72,7 +72,7 @@ static ssize_t transient_activate_store(struct device *dev,
72 if (state == 0 && transient_data->activate == 1) { 72 if (state == 0 && transient_data->activate == 1) {
73 del_timer(&transient_data->timer); 73 del_timer(&transient_data->timer);
74 transient_data->activate = state; 74 transient_data->activate = state;
75 led_set_brightness(led_cdev, transient_data->restore_state); 75 __led_set_brightness(led_cdev, transient_data->restore_state);
76 return size; 76 return size;
77 } 77 }
78 78
@@ -80,7 +80,7 @@ static ssize_t transient_activate_store(struct device *dev,
80 if (state == 1 && transient_data->activate == 0 && 80 if (state == 1 && transient_data->activate == 0 &&
81 transient_data->duration != 0) { 81 transient_data->duration != 0) {
82 transient_data->activate = state; 82 transient_data->activate = state;
83 led_set_brightness(led_cdev, transient_data->state); 83 __led_set_brightness(led_cdev, transient_data->state);
84 transient_data->restore_state = 84 transient_data->restore_state =
85 (transient_data->state == LED_FULL) ? LED_OFF : LED_FULL; 85 (transient_data->state == LED_FULL) ? LED_OFF : LED_FULL;
86 mod_timer(&transient_data->timer, 86 mod_timer(&transient_data->timer,
@@ -203,7 +203,7 @@ static void transient_trig_deactivate(struct led_classdev *led_cdev)
203 203
204 if (led_cdev->activated) { 204 if (led_cdev->activated) {
205 del_timer_sync(&transient_data->timer); 205 del_timer_sync(&transient_data->timer);
206 led_set_brightness(led_cdev, transient_data->restore_state); 206 __led_set_brightness(led_cdev, transient_data->restore_state);
207 device_remove_file(led_cdev->dev, &dev_attr_activate); 207 device_remove_file(led_cdev->dev, &dev_attr_activate);
208 device_remove_file(led_cdev->dev, &dev_attr_duration); 208 device_remove_file(led_cdev->dev, &dev_attr_duration);
209 device_remove_file(led_cdev->dev, &dev_attr_state); 209 device_remove_file(led_cdev->dev, &dev_attr_state);