leds: lm355x: rename devAttr to avoid CamelCase
[linux-3.10.git] / drivers / leds / ledtrig-gpio.c
index ecc4bf3..72e3ebf 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);
        }
 }
 
@@ -110,7 +110,7 @@ static ssize_t gpio_trig_inverted_store(struct device *dev,
        unsigned long inverted;
        int ret;
 
-       ret = strict_strtoul(buf, 10, &inverted);
+       ret = kstrtoul(buf, 10, &inverted);
        if (ret < 0)
                return ret;
 
@@ -200,6 +200,7 @@ static void gpio_trig_activate(struct led_classdev *led)
        gpio_data->led = led;
        led->trigger_data = gpio_data;
        INIT_WORK(&gpio_data->work, gpio_trig_work);
+       led->activated = true;
 
        return;
 
@@ -217,7 +218,7 @@ static void gpio_trig_deactivate(struct led_classdev *led)
 {
        struct gpio_trig_data *gpio_data = led->trigger_data;
 
-       if (gpio_data) {
+       if (led->activated) {
                device_remove_file(led->dev, &dev_attr_gpio);
                device_remove_file(led->dev, &dev_attr_inverted);
                device_remove_file(led->dev, &dev_attr_desired_brightness);
@@ -225,6 +226,7 @@ static void gpio_trig_deactivate(struct led_classdev *led)
                if (gpio_data->gpio != 0)
                        free_irq(gpio_to_irq(gpio_data->gpio), led);
                kfree(gpio_data);
+               led->activated = false;
        }
 }