aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/xenbus
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-07 02:55:49 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-16 21:36:03 -0400
commit85dd92686ffe774363330a6839a3fb9c78f19cf8 (patch)
tree3a66bcb7f9e7b2a28a74fddfc503ab229d453692 /drivers/xen/xenbus
parent4e9072d61695abcee201591ba9515a28bcb3bd33 (diff)
xenbus: 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 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>
Diffstat (limited to 'drivers/xen/xenbus')
-rw-r--r--drivers/xen/xenbus/xenbus_probe.c24
-rw-r--r--drivers/xen/xenbus/xenbus_probe.h2
-rw-r--r--drivers/xen/xenbus/xenbus_probe_backend.c2
-rw-r--r--drivers/xen/xenbus/xenbus_probe_frontend.c2
4 files changed, 21 insertions, 9 deletions
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
index 38e92b770e91..3c0a74b3e9b1 100644
--- a/drivers/xen/xenbus/xenbus_probe.c
+++ b/drivers/xen/xenbus/xenbus_probe.c
@@ -384,12 +384,14 @@ static ssize_t nodename_show(struct device *dev,
384{ 384{
385 return sprintf(buf, "%s\n", to_xenbus_device(dev)->nodename); 385 return sprintf(buf, "%s\n", to_xenbus_device(dev)->nodename);
386} 386}
387static DEVICE_ATTR_RO(nodename);
387 388
388static ssize_t devtype_show(struct device *dev, 389static ssize_t devtype_show(struct device *dev,
389 struct device_attribute *attr, char *buf) 390 struct device_attribute *attr, char *buf)
390{ 391{
391 return sprintf(buf, "%s\n", to_xenbus_device(dev)->devicetype); 392 return sprintf(buf, "%s\n", to_xenbus_device(dev)->devicetype);
392} 393}
394static DEVICE_ATTR_RO(devtype);
393 395
394static ssize_t modalias_show(struct device *dev, 396static ssize_t modalias_show(struct device *dev,
395 struct device_attribute *attr, char *buf) 397 struct device_attribute *attr, char *buf)
@@ -397,14 +399,24 @@ static ssize_t modalias_show(struct device *dev,
397 return sprintf(buf, "%s:%s\n", dev->bus->name, 399 return sprintf(buf, "%s:%s\n", dev->bus->name,
398 to_xenbus_device(dev)->devicetype); 400 to_xenbus_device(dev)->devicetype);
399} 401}
402static DEVICE_ATTR_RO(modalias);
400 403
401struct device_attribute xenbus_dev_attrs[] = { 404static struct attribute *xenbus_dev_attrs[] = {
402 __ATTR_RO(nodename), 405 &dev_attr_nodename.attr,
403 __ATTR_RO(devtype), 406 &dev_attr_devtype.attr,
404 __ATTR_RO(modalias), 407 &dev_attr_modalias.attr,
405 __ATTR_NULL 408 NULL,
406}; 409};
407EXPORT_SYMBOL_GPL(xenbus_dev_attrs); 410
411static const struct attribute_group xenbus_dev_group = {
412 .attrs = xenbus_dev_attrs,
413};
414
415const struct attribute_group *xenbus_dev_groups[] = {
416 &xenbus_dev_group,
417 NULL,
418};
419EXPORT_SYMBOL_GPL(xenbus_dev_groups);
408 420
409int xenbus_probe_node(struct xen_bus_type *bus, 421int xenbus_probe_node(struct xen_bus_type *bus,
410 const char *type, 422 const char *type,
diff --git a/drivers/xen/xenbus/xenbus_probe.h b/drivers/xen/xenbus/xenbus_probe.h
index 146f857a36f8..1085ec294a19 100644
--- a/drivers/xen/xenbus/xenbus_probe.h
+++ b/drivers/xen/xenbus/xenbus_probe.h
@@ -54,7 +54,7 @@ enum xenstore_init {
54 XS_LOCAL, 54 XS_LOCAL,
55}; 55};
56 56
57extern struct device_attribute xenbus_dev_attrs[]; 57extern const struct attribute_group *xenbus_dev_groups[];
58 58
59extern int xenbus_match(struct device *_dev, struct device_driver *_drv); 59extern int xenbus_match(struct device *_dev, struct device_driver *_drv);
60extern int xenbus_dev_probe(struct device *_dev); 60extern int xenbus_dev_probe(struct device *_dev);
diff --git a/drivers/xen/xenbus/xenbus_probe_backend.c b/drivers/xen/xenbus/xenbus_probe_backend.c
index 998bbbab816b..5125dce11a60 100644
--- a/drivers/xen/xenbus/xenbus_probe_backend.c
+++ b/drivers/xen/xenbus/xenbus_probe_backend.c
@@ -200,7 +200,7 @@ static struct xen_bus_type xenbus_backend = {
200 .probe = xenbus_dev_probe, 200 .probe = xenbus_dev_probe,
201 .remove = xenbus_dev_remove, 201 .remove = xenbus_dev_remove,
202 .shutdown = xenbus_dev_shutdown, 202 .shutdown = xenbus_dev_shutdown,
203 .dev_attrs = xenbus_dev_attrs, 203 .dev_groups = xenbus_dev_groups,
204 }, 204 },
205}; 205};
206 206
diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c
index 34b20bfa4e8c..129bf84c19ec 100644
--- a/drivers/xen/xenbus/xenbus_probe_frontend.c
+++ b/drivers/xen/xenbus/xenbus_probe_frontend.c
@@ -154,7 +154,7 @@ static struct xen_bus_type xenbus_frontend = {
154 .probe = xenbus_frontend_dev_probe, 154 .probe = xenbus_frontend_dev_probe,
155 .remove = xenbus_dev_remove, 155 .remove = xenbus_dev_remove,
156 .shutdown = xenbus_dev_shutdown, 156 .shutdown = xenbus_dev_shutdown,
157 .dev_attrs = xenbus_dev_attrs, 157 .dev_groups = xenbus_dev_groups,
158 158
159 .pm = &xenbus_pm_ops, 159 .pm = &xenbus_pm_ops,
160 }, 160 },