diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-09 15:43:27 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-09 15:43:27 -0700 |
| commit | 94ed31a17e12bd77b8a5982c6bf9623b9a623fe7 (patch) | |
| tree | 3468dad21566837ef07c8d4d6fe434fcaadd876a /video-backlight-lcd-convert-class-code-to-use-dev_groups.patch | |
| parent | aaf275f945460b5cb5ee6ea9ef95b06db5334461 (diff) | |
| download | patches-94ed31a17e12bd77b8a5982c6bf9623b9a623fe7.tar.gz | |
renamed patches and broke them up
Diffstat (limited to 'video-backlight-lcd-convert-class-code-to-use-dev_groups.patch')
| -rw-r--r-- | video-backlight-lcd-convert-class-code-to-use-dev_groups.patch | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/video-backlight-lcd-convert-class-code-to-use-dev_groups.patch b/video-backlight-lcd-convert-class-code-to-use-dev_groups.patch new file mode 100644 index 00000000000000..96a7bd0fa70e16 --- /dev/null +++ b/video-backlight-lcd-convert-class-code-to-use-dev_groups.patch @@ -0,0 +1,104 @@ +From foo@baz Tue Jul 9 15:40:31 PDT 2013 +Date: Tue, 09 Jul 2013 15:40:31 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: 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> +Cc: Jingoo Han <jg1.han@samsung.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + drivers/video/backlight/lcd.c | 26 +++++++++++++++----------- + 1 file changed, 15 insertions(+), 11 deletions(-) + +--- a/drivers/video/backlight/lcd.c ++++ b/drivers/video/backlight/lcd.c +@@ -89,7 +89,7 @@ static inline void lcd_unregister_fb(str + } + #endif /* CONFIG_FB */ + +-static ssize_t lcd_show_power(struct device *dev, struct device_attribute *attr, ++static ssize_t lcd_power_show(struct device *dev, struct device_attribute *attr, + char *buf) + { + int rc; +@@ -105,7 +105,7 @@ static ssize_t lcd_show_power(struct dev + return rc; + } + +-static ssize_t lcd_store_power(struct device *dev, ++static ssize_t lcd_power_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) + { + int rc; +@@ -128,8 +128,9 @@ static ssize_t lcd_store_power(struct de + + return rc; + } ++static DEVICE_ATTR_RW(lcd_power); + +-static ssize_t lcd_show_contrast(struct device *dev, ++static ssize_t contrast_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + int rc = -ENXIO; +@@ -143,7 +144,7 @@ static ssize_t lcd_show_contrast(struct + return rc; + } + +-static ssize_t lcd_store_contrast(struct device *dev, ++static ssize_t contrast_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) + { + int rc; +@@ -166,14 +167,16 @@ static ssize_t lcd_store_contrast(struct + + return rc; + } ++static DEVICE_ATTR_RW(contrast); + +-static ssize_t lcd_show_max_contrast(struct device *dev, ++static ssize_t max_contrast_show(struct device *dev, + struct device_attribute *attr, char *buf) + { + struct lcd_device *ld = to_lcd_device(dev); + + return sprintf(buf, "%d\n", ld->props.max_contrast); + } ++static DEVICE_ATTR_RO(max_contrast); + + static struct class *lcd_class; + +@@ -183,12 +186,13 @@ static void lcd_device_release(struct de + kfree(ld); + } + +-static struct device_attribute lcd_device_attributes[] = { +- __ATTR(lcd_power, 0644, lcd_show_power, lcd_store_power), +- __ATTR(contrast, 0644, lcd_show_contrast, lcd_store_contrast), +- __ATTR(max_contrast, 0444, lcd_show_max_contrast, NULL), +- __ATTR_NULL, ++static struct attribute *lcd_device_attrs[] = { ++ &dev_attr_lcd_power.attr, ++ &dev_attr_contrast.attr, ++ &dev_attr_max_contrast.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(lcd_device); + + /** + * lcd_device_register - register a new object of lcd_device class. +@@ -344,7 +348,7 @@ static int __init lcd_class_init(void) + return PTR_ERR(lcd_class); + } + +- lcd_class->dev_attrs = lcd_device_attributes; ++ lcd_class->dev_groups = lcd_device_groups; + return 0; + } + |
