aboutsummaryrefslogtreecommitdiffstats
path: root/p24.patch
blob: a3030e1e1df797fa68197944dc4a481a6b2b49d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
 sound/aoa/soundbus/core.c     |    2 +-
 sound/aoa/soundbus/soundbus.h |    2 +-
 sound/aoa/soundbus/sysfs.c    |   23 +++++++++++++++++------
 3 files changed, 19 insertions(+), 8 deletions(-)

--- a/sound/aoa/soundbus/core.c
+++ b/sound/aoa/soundbus/core.c
@@ -160,7 +160,7 @@ static struct bus_type soundbus_bus_type
 	.suspend	= soundbus_device_suspend,
 	.resume		= soundbus_device_resume,
 #endif
-	.dev_attrs	= soundbus_dev_attrs,
+	.dev_groups	= soundbus_dev_groups,
 };
 
 int soundbus_add_one(struct soundbus_dev *dev)
--- a/sound/aoa/soundbus/soundbus.h
+++ b/sound/aoa/soundbus/soundbus.h
@@ -199,6 +199,6 @@ struct soundbus_driver {
 extern int soundbus_register_driver(struct soundbus_driver *drv);
 extern void soundbus_unregister_driver(struct soundbus_driver *drv);
 
-extern struct device_attribute soundbus_dev_attrs[];
+extern const struct attribute_group *soundbus_dev_groups[];
 
 #endif /* __SOUNDBUS_H */
--- a/sound/aoa/soundbus/sysfs.c
+++ b/sound/aoa/soundbus/sysfs.c
@@ -10,7 +10,8 @@ field##_show (struct device *dev, struct
 {									\
 	struct soundbus_dev *mdev = to_soundbus_device (dev);		\
 	return sprintf (buf, format_string, mdev->ofdev.dev.of_node->field); \
-}
+}									\
+static DEVICE_ATTR_RO(field);
 
 static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
 			     char *buf)
@@ -30,13 +31,23 @@ static ssize_t modalias_show(struct devi
 
 	return length;
 }
+static DEVICE_ATTR_RO(modalias);
 
 soundbus_config_of_attr (name, "%s\n");
 soundbus_config_of_attr (type, "%s\n");
 
-struct device_attribute soundbus_dev_attrs[] = {
-	__ATTR_RO(name),
-	__ATTR_RO(type),
-	__ATTR_RO(modalias),
-	__ATTR_NULL
+static struct attribute *soundbus_dev_attrs[] = {
+	&dev_attr_name.attr,
+	&dev_attr_type.attr,
+	&dev_attr_modalias.attr,
+	NULL,
+};
+
+static const struct attribute_group soundbus_dev_group = {
+	.attrs = soundbus_dev_attrs,
+};
+
+const struct attribute_group *soundbus_dev_groups[] = {
+	&soundbus_dev_group,
+	NULL,
 };