Thread (55 messages) 55 messages, 5 authors, 2014-08-21
STALE4337d REVIEWED: 3 (3M)
Revisions (16)
  1. rfc [diff vs current]
  2. v4 current
  3. v8 [diff vs current]
  4. v9 [diff vs current]
  5. v10 [diff vs current]
  6. v11 [diff vs current]
  7. v12 [diff vs current]
  8. v13 [diff vs current]
  9. v1 [diff vs current]
  10. v2 [diff vs current]
  11. v4 [diff vs current]
  12. v5 [diff vs current]
  13. v6 [diff vs current]
  14. v8 [diff vs current]
  15. v9 [diff vs current]
  16. v10 [diff vs current]

[PATCH/RFC v4 05/21] leds: avoid using deprecated DEVICE_ATTR macro

From: Jacek Anaszewski <hidden>
Date: 2014-07-11 14:04:52
Also in: linux-leds, linux-media, lkml
Subsystem: led subsystem, the rest · Maintainers: Lee Jones, Pavel Machek, Linus Torvalds

Make the sysfs attributes definition consistent in the whole file.
The modification entails change of the function name:
led_max_brightness_show -> max_brightness_show

Signed-off-by: Jacek Anaszewski <redacted>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Bryan Wu <redacted>
Cc: Richard Purdie <redacted>
---
 drivers/leds/led-class.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 0127783..a96a1a7 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -60,14 +60,14 @@ unlock:
 }
 static DEVICE_ATTR_RW(brightness);
 
-static ssize_t led_max_brightness_show(struct device *dev,
+static ssize_t max_brightness_show(struct device *dev,
 		struct device_attribute *attr, char *buf)
 {
 	struct led_classdev *led_cdev = dev_get_drvdata(dev);
 
 	return sprintf(buf, "%u\n", led_cdev->max_brightness);
 }
-static DEVICE_ATTR(max_brightness, 0444, led_max_brightness_show, NULL);
+static DEVICE_ATTR_RO(max_brightness);
 
 #ifdef CONFIG_LEDS_TRIGGERS
 static DEVICE_ATTR(trigger, 0644, led_trigger_show, led_trigger_store);
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help