diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-24 18:05:31 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-25 19:34:40 -0400 |
| commit | d79fd03fd651bd91a081fc97f5f0d221557f8cbb (patch) | |
| tree | 63e1f5f01baf8cb0d717c0385fe292a38d2ca317 | |
| parent | ea1bb7064fd6972ef00a93ba882a2f38450b273e (diff) | |
video: backlight: lcd: convert class code to use dev_groups
The dev_attrs field of struct class is going away soon, dev_groups
should be used instead. This converts the video backlight lcd class
code to use the correct field.
Cc: Richard Purdie <rpurdie@rpsys.net>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/video/backlight/lcd.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index 41964a71a036..93cf15efc717 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c | |||
| @@ -89,7 +89,7 @@ static inline void lcd_unregister_fb(struct lcd_device *ld) | |||
| 89 | } | 89 | } |
| 90 | #endif /* CONFIG_FB */ | 90 | #endif /* CONFIG_FB */ |
| 91 | 91 | ||
| 92 | static ssize_t lcd_show_power(struct device *dev, struct device_attribute *attr, | 92 | static ssize_t lcd_power_show(struct device *dev, struct device_attribute *attr, |
| 93 | char *buf) | 93 | char *buf) |
| 94 | { | 94 | { |
| 95 | int rc; | 95 | int rc; |
| @@ -105,7 +105,7 @@ static ssize_t lcd_show_power(struct device *dev, struct device_attribute *attr, | |||
| 105 | return rc; | 105 | return rc; |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | static ssize_t lcd_store_power(struct device *dev, | 108 | static ssize_t lcd_power_store(struct device *dev, |
| 109 | struct device_attribute *attr, const char *buf, size_t count) | 109 | struct device_attribute *attr, const char *buf, size_t count) |
| 110 | { | 110 | { |
| 111 | int rc; | 111 | int rc; |
| @@ -128,8 +128,9 @@ static ssize_t lcd_store_power(struct device *dev, | |||
| 128 | 128 | ||
| 129 | return rc; | 129 | return rc; |
| 130 | } | 130 | } |
| 131 | static DEVICE_ATTR_RW(lcd_power); | ||
| 131 | 132 | ||
| 132 | static ssize_t lcd_show_contrast(struct device *dev, | 133 | static ssize_t contrast_show(struct device *dev, |
| 133 | struct device_attribute *attr, char *buf) | 134 | struct device_attribute *attr, char *buf) |
| 134 | { | 135 | { |
| 135 | int rc = -ENXIO; | 136 | int rc = -ENXIO; |
| @@ -143,7 +144,7 @@ static ssize_t lcd_show_contrast(struct device *dev, | |||
| 143 | return rc; | 144 | return rc; |
| 144 | } | 145 | } |
| 145 | 146 | ||
| 146 | static ssize_t lcd_store_contrast(struct device *dev, | 147 | static ssize_t contrast_store(struct device *dev, |
| 147 | struct device_attribute *attr, const char *buf, size_t count) | 148 | struct device_attribute *attr, const char *buf, size_t count) |
| 148 | { | 149 | { |
| 149 | int rc; | 150 | int rc; |
| @@ -166,14 +167,16 @@ static ssize_t lcd_store_contrast(struct device *dev, | |||
| 166 | 167 | ||
| 167 | return rc; | 168 | return rc; |
| 168 | } | 169 | } |
| 170 | static DEVICE_ATTR_RW(contrast); | ||
| 169 | 171 | ||
| 170 | static ssize_t lcd_show_max_contrast(struct device *dev, | 172 | static ssize_t max_contrast_show(struct device *dev, |
| 171 | struct device_attribute *attr, char *buf) | 173 | struct device_attribute *attr, char *buf) |
| 172 | { | 174 | { |
| 173 | struct lcd_device *ld = to_lcd_device(dev); | 175 | struct lcd_device *ld = to_lcd_device(dev); |
| 174 | 176 | ||
| 175 | return sprintf(buf, "%d\n", ld->props.max_contrast); | 177 | return sprintf(buf, "%d\n", ld->props.max_contrast); |
| 176 | } | 178 | } |
| 179 | static DEVICE_ATTR_RO(max_contrast); | ||
| 177 | 180 | ||
| 178 | static struct class *lcd_class; | 181 | static struct class *lcd_class; |
| 179 | 182 | ||
| @@ -183,12 +186,13 @@ static void lcd_device_release(struct device *dev) | |||
| 183 | kfree(ld); | 186 | kfree(ld); |
| 184 | } | 187 | } |
| 185 | 188 | ||
| 186 | static struct device_attribute lcd_device_attributes[] = { | 189 | static struct attribute *lcd_device_attrs[] = { |
| 187 | __ATTR(lcd_power, 0644, lcd_show_power, lcd_store_power), | 190 | &dev_attr_lcd_power.attr, |
| 188 | __ATTR(contrast, 0644, lcd_show_contrast, lcd_store_contrast), | 191 | &dev_attr_contrast.attr, |
| 189 | __ATTR(max_contrast, 0444, lcd_show_max_contrast, NULL), | 192 | &dev_attr_max_contrast.attr, |
| 190 | __ATTR_NULL, | 193 | NULL, |
| 191 | }; | 194 | }; |
| 195 | ATTRIBUTE_GROUPS(lcd_device); | ||
| 192 | 196 | ||
| 193 | /** | 197 | /** |
| 194 | * lcd_device_register - register a new object of lcd_device class. | 198 | * lcd_device_register - register a new object of lcd_device class. |
| @@ -344,7 +348,7 @@ static int __init lcd_class_init(void) | |||
| 344 | return PTR_ERR(lcd_class); | 348 | return PTR_ERR(lcd_class); |
| 345 | } | 349 | } |
| 346 | 350 | ||
| 347 | lcd_class->dev_attrs = lcd_device_attributes; | 351 | lcd_class->dev_groups = lcd_device_groups; |
| 348 | return 0; | 352 | return 0; |
| 349 | } | 353 | } |
| 350 | 354 | ||
