leds: Rename led_set_brightness() to __led_set_brightness()
authorShuah Khan <shuahkhan@gmail.com>
Wed, 13 Jun 2012 02:01:37 +0000 (10:01 +0800)
committerBryan Wu <bryan.wu@canonical.com>
Mon, 23 Jul 2012 23:52:34 +0000 (07:52 +0800)
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>
drivers/leds/led-class.c
drivers/leds/led-core.c
drivers/leds/led-triggers.c
drivers/leds/leds.h
drivers/leds/ledtrig-backlight.c
drivers/leds/ledtrig-default-on.c
drivers/leds/ledtrig-gpio.c
drivers/leds/ledtrig-heartbeat.c
drivers/leds/ledtrig-oneshot.c
drivers/leds/ledtrig-transient.c

index 81eb0916b44ad2588a0c6a6790b6d6cf192ccf20..cb0a6eb72a2c24eb080f780023956165f505e15c 100644 (file)
@@ -53,7 +53,7 @@ static ssize_t led_brightness_store(struct device *dev,
 
        if (state == LED_OFF)
                led_trigger_remove(led_cdev);
-       led_set_brightness(led_cdev, state);
+       __led_set_brightness(led_cdev, state);
 
        return size;
 }
@@ -82,7 +82,7 @@ static void led_timer_function(unsigned long data)
        unsigned long delay;
 
        if (!led_cdev->blink_delay_on || !led_cdev->blink_delay_off) {
-               led_set_brightness(led_cdev, LED_OFF);
+               __led_set_brightness(led_cdev, LED_OFF);
                return;
        }
 
@@ -105,7 +105,7 @@ static void led_timer_function(unsigned long data)
                delay = led_cdev->blink_delay_off;
        }
 
-       led_set_brightness(led_cdev, brightness);
+       __led_set_brightness(led_cdev, brightness);
 
        /* Return in next iteration if led is in one-shot mode and we are in
         * the final blink state so that the led is toggled each delay_on +
index 31f1f78ef40bde134df646189945edeef0b75ee2..176961b2db6b3c821e59ffd7017a7c61fb14feb4 100644 (file)
@@ -45,7 +45,7 @@ static void led_set_software_blink(struct led_classdev *led_cdev,
 
        /* never off - just set to brightness */
        if (!delay_off) {
-               led_set_brightness(led_cdev, led_cdev->blink_brightness);
+               __led_set_brightness(led_cdev, led_cdev->blink_brightness);
                return;
        }
 
@@ -111,6 +111,6 @@ void led_brightness_set(struct led_classdev *led_cdev,
        led_cdev->blink_delay_on = 0;
        led_cdev->blink_delay_off = 0;
 
-       led_set_brightness(led_cdev, brightness);
+       __led_set_brightness(led_cdev, brightness);
 }
 EXPORT_SYMBOL(led_brightness_set);
index fa0b9be019eaa6587eedc461d26331a081d61225..f8b14dd8c2b63c009a14b8c6fd538fe4c7e4bbe8 100644 (file)
@@ -224,7 +224,7 @@ void led_trigger_event(struct led_trigger *trig,
                struct led_classdev *led_cdev;
 
                led_cdev = list_entry(entry, struct led_classdev, trig_list);
-               led_set_brightness(led_cdev, brightness);
+               __led_set_brightness(led_cdev, brightness);
        }
        read_unlock(&trig->leddev_list_lock);
 }
index e77c7f8dcdd469bfa8b84472dabb81e2df1b10e7..d02acd4961269ab672ab11f1bc17960691496b05 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/rwsem.h>
 #include <linux/leds.h>
 
-static inline void led_set_brightness(struct led_classdev *led_cdev,
+static inline void __led_set_brightness(struct led_classdev *led_cdev,
                                        enum led_brightness value)
 {
        if (value > led_cdev->max_brightness)
index e2726867c5d42c7a5f2cc6c37b786d922eb0b883..b941685f222740970911b5fbbf93161304e76a37 100644 (file)
@@ -46,9 +46,9 @@ static int fb_notifier_callback(struct notifier_block *p,
 
                if ((n->old_status == UNBLANK) ^ n->invert) {
                        n->brightness = led->brightness;
-                       led_set_brightness(led, LED_OFF);
+                       __led_set_brightness(led, LED_OFF);
                } else {
-                       led_set_brightness(led, n->brightness);
+                       __led_set_brightness(led, n->brightness);
                }
 
                n->old_status = new_status;
@@ -87,9 +87,9 @@ static ssize_t bl_trig_invert_store(struct device *dev,
 
        /* After inverting, we need to update the LED. */
        if ((n->old_status == BLANK) ^ n->invert)
-               led_set_brightness(led, LED_OFF);
+               __led_set_brightness(led, LED_OFF);
        else
-               led_set_brightness(led, n->brightness);
+               __led_set_brightness(led, n->brightness);
 
        return num;
 }
index a4ef54b9d508efffe60b0cd4db2213479680547e..eac1f1b1adac97fb96e514be5d8d0e18d447ca2a 100644 (file)
@@ -19,7 +19,7 @@
 
 static void defon_trig_activate(struct led_classdev *led_cdev)
 {
-       led_set_brightness(led_cdev, led_cdev->max_brightness);
+       __led_set_brightness(led_cdev, led_cdev->max_brightness);
 }
 
 static struct led_trigger defon_led_trigger = {
index f057c101b896e56561a41f54809e1a10e52d0aaa..ba215dc42f9861ad41db278a970e37a6aedeceae 100644 (file)
@@ -54,12 +54,12 @@ static void gpio_trig_work(struct work_struct *work)
 
        if (tmp) {
                if (gpio_data->desired_brightness)
-                       led_set_brightness(gpio_data->led,
+                       __led_set_brightness(gpio_data->led,
                                           gpio_data->desired_brightness);
                else
-                       led_set_brightness(gpio_data->led, LED_FULL);
+                       __led_set_brightness(gpio_data->led, LED_FULL);
        } else {
-               led_set_brightness(gpio_data->led, LED_OFF);
+               __led_set_brightness(gpio_data->led, LED_OFF);
        }
 }
 
index a019fbb70880bd402aea095b8b90a8ca26a0e66a..1edc7463ce8381141d1d23abc779e4c5af9aa19d 100644 (file)
@@ -74,7 +74,7 @@ static void led_heartbeat_function(unsigned long data)
                break;
        }
 
-       led_set_brightness(led_cdev, brightness);
+       __led_set_brightness(led_cdev, brightness);
        mod_timer(&heartbeat_data->timer, jiffies + delay);
 }
 
index 5c9edf7f489cdef81be6fad6f9d14c08a6f990e4..5cbab41a8da29534dfd7d01515af72abfa360a7d 100644 (file)
@@ -63,9 +63,9 @@ static ssize_t led_invert_store(struct device *dev,
        oneshot_data->invert = !!state;
 
        if (oneshot_data->invert)
-               led_set_brightness(led_cdev, LED_FULL);
+               __led_set_brightness(led_cdev, LED_FULL);
        else
-               led_set_brightness(led_cdev, LED_OFF);
+               __led_set_brightness(led_cdev, LED_OFF);
 
        return size;
 }
index 83179f435e1e141884840941ce73d8d9cb4ce8f4..398f1042c43ef7193beb48c1e37ed4297906789b 100644 (file)
@@ -41,7 +41,7 @@ static void transient_timer_function(unsigned long data)
        struct transient_trig_data *transient_data = led_cdev->trigger_data;
 
        transient_data->activate = 0;
-       led_set_brightness(led_cdev, transient_data->restore_state);
+       __led_set_brightness(led_cdev, transient_data->restore_state);
 }
 
 static ssize_t transient_activate_show(struct device *dev,
@@ -72,7 +72,7 @@ static ssize_t transient_activate_store(struct device *dev,
        if (state == 0 && transient_data->activate == 1) {
                del_timer(&transient_data->timer);
                transient_data->activate = state;
-               led_set_brightness(led_cdev, transient_data->restore_state);
+               __led_set_brightness(led_cdev, transient_data->restore_state);
                return size;
        }
 
@@ -80,7 +80,7 @@ static ssize_t transient_activate_store(struct device *dev,
        if (state == 1 && transient_data->activate == 0 &&
            transient_data->duration != 0) {
                transient_data->activate = state;
-               led_set_brightness(led_cdev, transient_data->state);
+               __led_set_brightness(led_cdev, transient_data->state);
                transient_data->restore_state =
                    (transient_data->state == LED_FULL) ? LED_OFF : LED_FULL;
                mod_timer(&transient_data->timer,
@@ -203,7 +203,7 @@ static void transient_trig_deactivate(struct led_classdev *led_cdev)
 
        if (led_cdev->activated) {
                del_timer_sync(&transient_data->timer);
-               led_set_brightness(led_cdev, transient_data->restore_state);
+               __led_set_brightness(led_cdev, transient_data->restore_state);
                device_remove_file(led_cdev->dev, &dev_attr_activate);
                device_remove_file(led_cdev->dev, &dev_attr_duration);
                device_remove_file(led_cdev->dev, &dev_attr_state);