]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
i2o: convert bus code to use dev_groups
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Oct 2013 01:27:42 +0000 (18:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2013 01:40:58 +0000 (18:40 -0700)
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>
drivers/message/i2o/core.h
drivers/message/i2o/device.c
drivers/message/i2o/driver.c

index cbe384fb848c97078d609a751d34a8d0f627cfa7..91614f11f89a38d719b6091b9c7b8654557df3bc 100644 (file)
@@ -33,7 +33,7 @@ extern int __init i2o_pci_init(void);
 extern void __exit i2o_pci_exit(void);
 
 /* device */
-extern struct device_attribute i2o_device_attrs[];
+extern const struct attribute_group *i2o_device_groups[];
 
 extern void i2o_device_remove(struct i2o_device *);
 extern int i2o_device_parse_lct(struct i2o_controller *);
index 4547db99f7da7d6e321894419a15f5ec3c6413b8..98348f420b52b9aae3dee2c274122739fc5ef931 100644 (file)
@@ -138,45 +138,55 @@ static void i2o_device_release(struct device *dev)
 }
 
 /**
- *     i2o_device_show_class_id - Displays class id of I2O device
+ *     class_id_show - Displays class id of I2O device
  *     @dev: device of which the class id should be displayed
  *     @attr: pointer to device attribute
  *     @buf: buffer into which the class id should be printed
  *
  *     Returns the number of bytes which are printed into the buffer.
  */
-static ssize_t i2o_device_show_class_id(struct device *dev,
-                                       struct device_attribute *attr,
-                                       char *buf)
+static ssize_t class_id_show(struct device *dev, struct device_attribute *attr,
+                            char *buf)
 {
        struct i2o_device *i2o_dev = to_i2o_device(dev);
 
        sprintf(buf, "0x%03x\n", i2o_dev->lct_data.class_id);
        return strlen(buf) + 1;
 }
+static DEVICE_ATTR_RO(class_id);
 
 /**
- *     i2o_device_show_tid - Displays TID of I2O device
+ *     tid_show - Displays TID of I2O device
  *     @dev: device of which the TID should be displayed
  *     @attr: pointer to device attribute
  *     @buf: buffer into which the TID should be printed
  *
  *     Returns the number of bytes which are printed into the buffer.
  */
-static ssize_t i2o_device_show_tid(struct device *dev,
-                                  struct device_attribute *attr, char *buf)
+static ssize_t tid_show(struct device *dev, struct device_attribute *attr,
+                       char *buf)
 {
        struct i2o_device *i2o_dev = to_i2o_device(dev);
 
        sprintf(buf, "0x%03x\n", i2o_dev->lct_data.tid);
        return strlen(buf) + 1;
 }
+static DEVICE_ATTR_RO(tid);
 
 /* I2O device attributes */
-struct device_attribute i2o_device_attrs[] = {
-       __ATTR(class_id, S_IRUGO, i2o_device_show_class_id, NULL),
-       __ATTR(tid, S_IRUGO, i2o_device_show_tid, NULL),
-       __ATTR_NULL
+static struct attribute *i2o_device_attrs[] = {
+       &dev_attr_class_id.attr,
+       &dev_attr_tid.attr,
+       NULL,
+};
+
+static const struct attribute_group i2o_device_group = {
+       .attrs = i2o_device_attrs,
+};
+
+const struct attribute_group *i2o_device_groups[] = {
+       &i2o_device_group,
+       NULL,
 };
 
 /**
index 813eaa33fa1431af96a2c2f3ac40b1000dd9ed7b..b6b92d760510be0f5cd92009a616fbccc9ce088d 100644 (file)
@@ -62,7 +62,7 @@ static int i2o_bus_match(struct device *dev, struct device_driver *drv)
 struct bus_type i2o_bus_type = {
        .name = "i2o",
        .match = i2o_bus_match,
-       .dev_attrs = i2o_device_attrs
+       .dev_groups = i2o_device_groups,
 };
 
 /**