diff options
Diffstat (limited to 'drivers/rapidio/rio-sysfs.c')
-rw-r--r-- | drivers/rapidio/rio-sysfs.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/drivers/rapidio/rio-sysfs.c b/drivers/rapidio/rio-sysfs.c index 795a4776cb0c..e0221c6d0cc2 100644 --- a/drivers/rapidio/rio-sysfs.c +++ b/drivers/rapidio/rio-sysfs.c | |||
@@ -27,6 +27,7 @@ field##_show(struct device *dev, struct device_attribute *attr, char *buf) \ | |||
27 | \ | 27 | \ |
28 | return sprintf(buf, format_string, rdev->field); \ | 28 | return sprintf(buf, format_string, rdev->field); \ |
29 | } \ | 29 | } \ |
30 | static DEVICE_ATTR_RO(field); | ||
30 | 31 | ||
31 | rio_config_attr(did, "0x%04x\n"); | 32 | rio_config_attr(did, "0x%04x\n"); |
32 | rio_config_attr(vid, "0x%04x\n"); | 33 | rio_config_attr(vid, "0x%04x\n"); |
@@ -54,6 +55,7 @@ static ssize_t routes_show(struct device *dev, struct device_attribute *attr, ch | |||
54 | 55 | ||
55 | return (str - buf); | 56 | return (str - buf); |
56 | } | 57 | } |
58 | static DEVICE_ATTR_RO(routes); | ||
57 | 59 | ||
58 | static ssize_t lprev_show(struct device *dev, | 60 | static ssize_t lprev_show(struct device *dev, |
59 | struct device_attribute *attr, char *buf) | 61 | struct device_attribute *attr, char *buf) |
@@ -63,6 +65,7 @@ static ssize_t lprev_show(struct device *dev, | |||
63 | return sprintf(buf, "%s\n", | 65 | return sprintf(buf, "%s\n", |
64 | (rdev->prev) ? rio_name(rdev->prev) : "root"); | 66 | (rdev->prev) ? rio_name(rdev->prev) : "root"); |
65 | } | 67 | } |
68 | static DEVICE_ATTR_RO(lprev); | ||
66 | 69 | ||
67 | static ssize_t lnext_show(struct device *dev, | 70 | static ssize_t lnext_show(struct device *dev, |
68 | struct device_attribute *attr, char *buf) | 71 | struct device_attribute *attr, char *buf) |
@@ -83,6 +86,7 @@ static ssize_t lnext_show(struct device *dev, | |||
83 | 86 | ||
84 | return str - buf; | 87 | return str - buf; |
85 | } | 88 | } |
89 | static DEVICE_ATTR_RO(lnext); | ||
86 | 90 | ||
87 | static ssize_t modalias_show(struct device *dev, | 91 | static ssize_t modalias_show(struct device *dev, |
88 | struct device_attribute *attr, char *buf) | 92 | struct device_attribute *attr, char *buf) |
@@ -92,23 +96,29 @@ static ssize_t modalias_show(struct device *dev, | |||
92 | return sprintf(buf, "rapidio:v%04Xd%04Xav%04Xad%04X\n", | 96 | return sprintf(buf, "rapidio:v%04Xd%04Xav%04Xad%04X\n", |
93 | rdev->vid, rdev->did, rdev->asm_vid, rdev->asm_did); | 97 | rdev->vid, rdev->did, rdev->asm_vid, rdev->asm_did); |
94 | } | 98 | } |
99 | static DEVICE_ATTR_RO(modalias); | ||
100 | |||
101 | static struct attribute *rio_dev_attrs[] = { | ||
102 | &dev_attr_did.attr, | ||
103 | &dev_attr_vid.attr, | ||
104 | &dev_attr_device_rev.attr, | ||
105 | &dev_attr_asm_did.attr, | ||
106 | &dev_attr_asm_vid.attr, | ||
107 | &dev_attr_asm_rev.attr, | ||
108 | &dev_attr_lprev.attr, | ||
109 | &dev_attr_destid.attr, | ||
110 | &dev_attr_modalias.attr, | ||
111 | NULL, | ||
112 | }; | ||
95 | 113 | ||
96 | struct device_attribute rio_dev_attrs[] = { | 114 | static const struct attribute_group rio_dev_group = { |
97 | __ATTR_RO(did), | 115 | .attrs = rio_dev_attrs, |
98 | __ATTR_RO(vid), | ||
99 | __ATTR_RO(device_rev), | ||
100 | __ATTR_RO(asm_did), | ||
101 | __ATTR_RO(asm_vid), | ||
102 | __ATTR_RO(asm_rev), | ||
103 | __ATTR_RO(lprev), | ||
104 | __ATTR_RO(destid), | ||
105 | __ATTR_RO(modalias), | ||
106 | __ATTR_NULL, | ||
107 | }; | 116 | }; |
108 | 117 | ||
109 | static DEVICE_ATTR(routes, S_IRUGO, routes_show, NULL); | 118 | const struct attribute_group *rio_dev_groups[] = { |
110 | static DEVICE_ATTR(lnext, S_IRUGO, lnext_show, NULL); | 119 | &rio_dev_group, |
111 | static DEVICE_ATTR(hopcount, S_IRUGO, hopcount_show, NULL); | 120 | NULL, |
121 | }; | ||
112 | 122 | ||
113 | static ssize_t | 123 | static ssize_t |
114 | rio_read_config(struct file *filp, struct kobject *kobj, | 124 | rio_read_config(struct file *filp, struct kobject *kobj, |