|
9 | 9 | * published by the Free Software Foundation. |
10 | 10 | */ |
11 | 11 |
|
12 | | -#include <linux/module.h> |
13 | | -#include <linux/kernel.h> |
| 12 | +#include <linux/ctype.h> |
| 13 | +#include <linux/device.h> |
| 14 | +#include <linux/err.h> |
14 | 15 | #include <linux/init.h> |
| 16 | +#include <linux/kernel.h> |
| 17 | +#include <linux/leds.h> |
15 | 18 | #include <linux/list.h> |
| 19 | +#include <linux/module.h> |
| 20 | +#include <linux/slab.h> |
16 | 21 | #include <linux/spinlock.h> |
17 | | -#include <linux/device.h> |
18 | 22 | #include <linux/timer.h> |
19 | | -#include <linux/err.h> |
20 | | -#include <linux/ctype.h> |
21 | | -#include <linux/leds.h> |
22 | 23 | #include "leds.h" |
23 | 24 |
|
24 | 25 | static struct class *leds_class; |
25 | 26 |
|
26 | | -static void led_update_brightness(struct led_classdev *led_cdev) |
27 | | -{ |
28 | | - if (led_cdev->brightness_get) |
29 | | - led_cdev->brightness = led_cdev->brightness_get(led_cdev); |
30 | | -} |
31 | | - |
32 | 27 | static ssize_t brightness_show(struct device *dev, |
33 | 28 | struct device_attribute *attr, char *buf) |
34 | 29 | { |
@@ -59,14 +54,14 @@ static ssize_t brightness_store(struct device *dev, |
59 | 54 | } |
60 | 55 | static DEVICE_ATTR_RW(brightness); |
61 | 56 |
|
62 | | -static ssize_t led_max_brightness_show(struct device *dev, |
| 57 | +static ssize_t max_brightness_show(struct device *dev, |
63 | 58 | struct device_attribute *attr, char *buf) |
64 | 59 | { |
65 | 60 | struct led_classdev *led_cdev = dev_get_drvdata(dev); |
66 | 61 |
|
67 | 62 | return sprintf(buf, "%u\n", led_cdev->max_brightness); |
68 | 63 | } |
69 | | -static DEVICE_ATTR(max_brightness, 0444, led_max_brightness_show, NULL); |
| 64 | +static DEVICE_ATTR_RO(max_brightness); |
70 | 65 |
|
71 | 66 | #ifdef CONFIG_LEDS_TRIGGERS |
72 | 67 | static DEVICE_ATTR(trigger, 0644, led_trigger_show, led_trigger_store); |
|
0 commit comments