~ubuntu-branches/ubuntu/saucy/linux-ti-omap4/saucy-proposed

« back to all changes in this revision

Viewing changes to drivers/leds/led-class.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Stefan Bader, Upstream Kernel Changes
  • Date: 2012-08-15 17:17:43 UTC
  • Revision ID: package-import@ubuntu.com-20120815171743-h5wnuf51xe7pvdid
Tags: 3.5.0-207.13
[ Paolo Pisati ]

* Start new release

[ Stefan Bader ]

* (config) Enable getabis to use local package copies

[ Upstream Kernel Changes ]

* fixup: gargabe collect iva_seq[0|1] init
* [Config] enable all SND_OMAP_SOC_*s
* fixup: cm2xxx_3xxx.o is needed for omap2_cm_read|write_reg
* fixup: add some snd_soc_dai* helper functions
* fixup: s/snd_soc_dpcm_params/snd_soc_dpcm/g
* fixup: typo, no_host_mode and useless SDP4430 init
* fixup: enable again aess hwmod

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
                led_cdev->brightness = led_cdev->brightness_get(led_cdev);
30
30
}
31
31
 
32
 
static ssize_t led_brightness_show(struct device *dev, 
 
32
static ssize_t led_brightness_show(struct device *dev,
33
33
                struct device_attribute *attr, char *buf)
34
34
{
35
35
        struct led_classdev *led_cdev = dev_get_drvdata(dev);
44
44
                struct device_attribute *attr, const char *buf, size_t size)
45
45
{
46
46
        struct led_classdev *led_cdev = dev_get_drvdata(dev);
 
47
        unsigned long state;
47
48
        ssize_t ret = -EINVAL;
48
 
        char *after;
49
 
        unsigned long state = simple_strtoul(buf, &after, 10);
50
 
        size_t count = after - buf;
51
 
 
52
 
        if (isspace(*after))
53
 
                count++;
54
 
 
55
 
        if (count == size) {
56
 
                ret = count;
57
 
 
58
 
                if (state == LED_OFF)
59
 
                        led_trigger_remove(led_cdev);
60
 
                led_set_brightness(led_cdev, state);
61
 
        }
62
 
 
63
 
        return ret;
 
49
 
 
50
        ret = kstrtoul(buf, 10, &state);
 
51
        if (ret)
 
52
                return ret;
 
53
 
 
54
        if (state == LED_OFF)
 
55
                led_trigger_remove(led_cdev);
 
56
        led_set_brightness(led_cdev, state);
 
57
 
 
58
        return size;
64
59
}
65
60
 
66
61
static ssize_t led_max_brightness_show(struct device *dev,