Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+23 -13
+1 -1
drivers/message/i2o/core.h
··· 33 33 extern void __exit i2o_pci_exit(void); 34 34 35 35 /* device */ 36 - extern struct device_attribute i2o_device_attrs[]; 36 + extern const struct attribute_group *i2o_device_groups[]; 37 37 38 38 extern void i2o_device_remove(struct i2o_device *); 39 39 extern int i2o_device_parse_lct(struct i2o_controller *);
+21 -11
drivers/message/i2o/device.c
··· 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 142 * @dev: device of which the class id should be displayed 143 143 * @attr: pointer to device attribute 144 144 * @buf: buffer into which the class id should be printed 145 145 * 146 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, 149 - struct device_attribute *attr, 150 - char *buf) 148 + static ssize_t class_id_show(struct device *dev, struct device_attribute *attr, 149 + char *buf) 151 150 { 152 151 struct i2o_device *i2o_dev = to_i2o_device(dev); 153 152 154 153 sprintf(buf, "0x%03x\n", i2o_dev->lct_data.class_id); 155 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 160 * @dev: device of which the TID should be displayed 161 161 * @attr: pointer to device attribute 162 162 * @buf: buffer into which the TID should be printed 163 163 * 164 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, 167 - struct device_attribute *attr, char *buf) 166 + static ssize_t tid_show(struct device *dev, struct device_attribute *attr, 167 + char *buf) 168 168 { 169 169 struct i2o_device *i2o_dev = to_i2o_device(dev); 170 170 171 171 sprintf(buf, "0x%03x\n", i2o_dev->lct_data.tid); 172 172 return strlen(buf) + 1; 173 173 } 174 + static DEVICE_ATTR_RO(tid); 174 175 175 176 /* I2O device attributes */ 176 - struct device_attribute i2o_device_attrs[] = { 177 - __ATTR(class_id, S_IRUGO, i2o_device_show_class_id, NULL), 178 - __ATTR(tid, S_IRUGO, i2o_device_show_tid, NULL), 179 - __ATTR_NULL 177 + static struct attribute *i2o_device_attrs[] = { 178 + &dev_attr_class_id.attr, 179 + &dev_attr_tid.attr, 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 /**
+1 -1
drivers/message/i2o/driver.c
··· 62 62 struct bus_type i2o_bus_type = { 63 63 .name = "i2o", 64 64 .match = i2o_bus_match, 65 - .dev_attrs = i2o_device_attrs 65 + .dev_groups = i2o_device_groups, 66 66 }; 67 67 68 68 /**