diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-07 21:27:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-16 21:40:58 -0400 |
commit | ba6857b2d49646f2d4c245ff58d95d145f380177 (patch) | |
tree | 29771d7ae3c2c80e09ec1742e78b81567c0475e0 | |
parent | b785464bdbe6a98730f0984c14ec8d4cf7ec9980 (diff) |
i2o: convert bus code to use dev_groups
The dev_attrs field of struct bus_type is going away soon, dev_groups
should be used instead. This converts the i2o bus code to use the
correct field.
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/message/i2o/core.h | 2 | ||||
-rw-r--r-- | drivers/message/i2o/device.c | 32 | ||||
-rw-r--r-- | drivers/message/i2o/driver.c | 2 |
3 files changed, 23 insertions, 13 deletions
diff --git a/drivers/message/i2o/core.h b/drivers/message/i2o/core.h index cbe384fb848c..91614f11f89a 100644 --- a/drivers/message/i2o/core.h +++ b/drivers/message/i2o/core.h | |||
@@ -33,7 +33,7 @@ extern int __init i2o_pci_init(void); | |||
33 | extern void __exit i2o_pci_exit(void); | 33 | extern void __exit i2o_pci_exit(void); |
34 | 34 | ||
35 | /* device */ | 35 | /* device */ |
36 | extern struct device_attribute i2o_device_attrs[]; | 36 | extern const struct attribute_group *i2o_device_groups[]; |
37 | 37 | ||
38 | extern void i2o_device_remove(struct i2o_device *); | 38 | extern void i2o_device_remove(struct i2o_device *); |
39 | extern int i2o_device_parse_lct(struct i2o_controller *); | 39 | extern int i2o_device_parse_lct(struct i2o_controller *); |
diff --git a/drivers/message/i2o/device.c b/drivers/message/i2o/device.c index 4547db99f7da..98348f420b52 100644 --- a/drivers/message/i2o/device.c +++ b/drivers/message/i2o/device.c | |||
@@ -138,45 +138,55 @@ static void i2o_device_release(struct device *dev) | |||
138 | } | 138 | } |
139 | 139 | ||
140 | /** | 140 | /** |
141 | * i2o_device_show_class_id - Displays class id of I2O device | 141 | * class_id_show - Displays class id of I2O device |
142 | * @dev: device of which the class id should be displayed | 142 | * @dev: device of which the class id should be displayed |
143 | * @attr: pointer to device attribute | 143 | * @attr: pointer to device attribute |
144 | * @buf: buffer into which the class id should be printed | 144 | * @buf: buffer into which the class id should be printed |
145 | * | 145 | * |
146 | * Returns the number of bytes which are printed into the buffer. | 146 | * Returns the number of bytes which are printed into the buffer. |
147 | */ | 147 | */ |
148 | static ssize_t i2o_device_show_class_id(struct device *dev, | 148 | static ssize_t class_id_show(struct device *dev, struct device_attribute *attr, |
149 | struct device_attribute *attr, | 149 | char *buf) |
150 | char *buf) | ||
151 | { | 150 | { |
152 | struct i2o_device *i2o_dev = to_i2o_device(dev); | 151 | struct i2o_device *i2o_dev = to_i2o_device(dev); |
153 | 152 | ||
154 | sprintf(buf, "0x%03x\n", i2o_dev->lct_data.class_id); | 153 | sprintf(buf, "0x%03x\n", i2o_dev->lct_data.class_id); |
155 | return strlen(buf) + 1; | 154 | return strlen(buf) + 1; |
156 | } | 155 | } |
156 | static DEVICE_ATTR_RO(class_id); | ||
157 | 157 | ||
158 | /** | 158 | /** |
159 | * i2o_device_show_tid - Displays TID of I2O device | 159 | * tid_show - Displays TID of I2O device |
160 | * @dev: device of which the TID should be displayed | 160 | * @dev: device of which the TID should be displayed |
161 | * @attr: pointer to device attribute | 161 | * @attr: pointer to device attribute |
162 | * @buf: buffer into which the TID should be printed | 162 | * @buf: buffer into which the TID should be printed |
163 | * | 163 | * |
164 | * Returns the number of bytes which are printed into the buffer. | 164 | * Returns the number of bytes which are printed into the buffer. |
165 | */ | 165 | */ |
166 | static ssize_t i2o_device_show_tid(struct device *dev, | 166 | static ssize_t tid_show(struct device *dev, struct device_attribute *attr, |
167 | struct device_attribute *attr, char *buf) | 167 | char *buf) |
168 | { | 168 | { |
169 | struct i2o_device *i2o_dev = to_i2o_device(dev); | 169 | struct i2o_device *i2o_dev = to_i2o_device(dev); |
170 | 170 | ||
171 | sprintf(buf, "0x%03x\n", i2o_dev->lct_data.tid); | 171 | sprintf(buf, "0x%03x\n", i2o_dev->lct_data.tid); |
172 | return strlen(buf) + 1; | 172 | return strlen(buf) + 1; |
173 | } | 173 | } |
174 | static DEVICE_ATTR_RO(tid); | ||
174 | 175 | ||
175 | /* I2O device attributes */ | 176 | /* I2O device attributes */ |
176 | struct device_attribute i2o_device_attrs[] = { | 177 | static struct attribute *i2o_device_attrs[] = { |
177 | __ATTR(class_id, S_IRUGO, i2o_device_show_class_id, NULL), | 178 | &dev_attr_class_id.attr, |
178 | __ATTR(tid, S_IRUGO, i2o_device_show_tid, NULL), | 179 | &dev_attr_tid.attr, |
179 | __ATTR_NULL | 180 | NULL, |
181 | }; | ||
182 | |||
183 | static const struct attribute_group i2o_device_group = { | ||
184 | .attrs = i2o_device_attrs, | ||
185 | }; | ||
186 | |||
187 | const struct attribute_group *i2o_device_groups[] = { | ||
188 | &i2o_device_group, | ||
189 | NULL, | ||
180 | }; | 190 | }; |
181 | 191 | ||
182 | /** | 192 | /** |
diff --git a/drivers/message/i2o/driver.c b/drivers/message/i2o/driver.c index 813eaa33fa14..b6b92d760510 100644 --- a/drivers/message/i2o/driver.c +++ b/drivers/message/i2o/driver.c | |||
@@ -62,7 +62,7 @@ static int i2o_bus_match(struct device *dev, struct device_driver *drv) | |||
62 | struct bus_type i2o_bus_type = { | 62 | struct bus_type i2o_bus_type = { |
63 | .name = "i2o", | 63 | .name = "i2o", |
64 | .match = i2o_bus_match, | 64 | .match = i2o_bus_match, |
65 | .dev_attrs = i2o_device_attrs | 65 | .dev_groups = i2o_device_groups, |
66 | }; | 66 | }; |
67 | 67 | ||
68 | /** | 68 | /** |