xenbus: convert bus code to use dev_groups
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Oct 2013 06:55:49 +0000 (23:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2013 01:36:03 +0000 (18:36 -0700)
The dev_attrs field of struct bus_type is going away soon, dev_groups
should be used instead.  This converts the xenbus code to use the
correct field.

Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: <xen-devel@lists.xenproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/xen/xenbus/xenbus_probe.c
drivers/xen/xenbus/xenbus_probe.h
drivers/xen/xenbus/xenbus_probe_backend.c
drivers/xen/xenbus/xenbus_probe_frontend.c

index 38e92b770e91f224209dab2fc0e5543e8591bb65..3c0a74b3e9b15af5355c8619294805f59030f75d 100644 (file)
@@ -384,12 +384,14 @@ static ssize_t nodename_show(struct device *dev,
 {
        return sprintf(buf, "%s\n", to_xenbus_device(dev)->nodename);
 }
+static DEVICE_ATTR_RO(nodename);
 
 static ssize_t devtype_show(struct device *dev,
                            struct device_attribute *attr, char *buf)
 {
        return sprintf(buf, "%s\n", to_xenbus_device(dev)->devicetype);
 }
+static DEVICE_ATTR_RO(devtype);
 
 static ssize_t modalias_show(struct device *dev,
                             struct device_attribute *attr, char *buf)
@@ -397,14 +399,24 @@ static ssize_t modalias_show(struct device *dev,
        return sprintf(buf, "%s:%s\n", dev->bus->name,
                       to_xenbus_device(dev)->devicetype);
 }
+static DEVICE_ATTR_RO(modalias);
 
-struct device_attribute xenbus_dev_attrs[] = {
-       __ATTR_RO(nodename),
-       __ATTR_RO(devtype),
-       __ATTR_RO(modalias),
-       __ATTR_NULL
+static struct attribute *xenbus_dev_attrs[] = {
+       &dev_attr_nodename.attr,
+       &dev_attr_devtype.attr,
+       &dev_attr_modalias.attr,
+       NULL,
 };
-EXPORT_SYMBOL_GPL(xenbus_dev_attrs);
+
+static const struct attribute_group xenbus_dev_group = {
+       .attrs = xenbus_dev_attrs,
+};
+
+const struct attribute_group *xenbus_dev_groups[] = {
+       &xenbus_dev_group,
+       NULL,
+};
+EXPORT_SYMBOL_GPL(xenbus_dev_groups);
 
 int xenbus_probe_node(struct xen_bus_type *bus,
                      const char *type,
index 146f857a36f83b5a2f4646424c1251a23abf1b07..1085ec294a1987a5620b24c4a2e120528d13cac0 100644 (file)
@@ -54,7 +54,7 @@ enum xenstore_init {
        XS_LOCAL,
 };
 
-extern struct device_attribute xenbus_dev_attrs[];
+extern const struct attribute_group *xenbus_dev_groups[];
 
 extern int xenbus_match(struct device *_dev, struct device_driver *_drv);
 extern int xenbus_dev_probe(struct device *_dev);
index 998bbbab816be6c59a4a71b8b183a2a39f053aff..5125dce11a6083da92fc5942a09c2aa786f181d8 100644 (file)
@@ -200,7 +200,7 @@ static struct xen_bus_type xenbus_backend = {
                .probe          = xenbus_dev_probe,
                .remove         = xenbus_dev_remove,
                .shutdown       = xenbus_dev_shutdown,
-               .dev_attrs      = xenbus_dev_attrs,
+               .dev_groups     = xenbus_dev_groups,
        },
 };
 
index 34b20bfa4e8c3cf813194a45c4545e01c1d88eb1..129bf84c19ec999f5e239c1b7168089955a29bec 100644 (file)
@@ -154,7 +154,7 @@ static struct xen_bus_type xenbus_frontend = {
                .probe          = xenbus_frontend_dev_probe,
                .remove         = xenbus_dev_remove,
                .shutdown       = xenbus_dev_shutdown,
-               .dev_attrs      = xenbus_dev_attrs,
+               .dev_groups     = xenbus_dev_groups,
 
                .pm             = &xenbus_pm_ops,
        },