diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-07 02:55:49 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-16 21:36:03 -0400 |
commit | 85dd92686ffe774363330a6839a3fb9c78f19cf8 (patch) | |
tree | 3a66bcb7f9e7b2a28a74fddfc503ab229d453692 /drivers/xen/xenbus | |
parent | 4e9072d61695abcee201591ba9515a28bcb3bd33 (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.c | 24 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_probe.h | 2 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_probe_backend.c | 2 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_probe_frontend.c | 2 |
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 | } |
387 | static DEVICE_ATTR_RO(nodename); | ||
387 | 388 | ||
388 | static ssize_t devtype_show(struct device *dev, | 389 | static 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 | } |
394 | static DEVICE_ATTR_RO(devtype); | ||
393 | 395 | ||
394 | static ssize_t modalias_show(struct device *dev, | 396 | static 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 | } |
402 | static DEVICE_ATTR_RO(modalias); | ||
400 | 403 | ||
401 | struct device_attribute xenbus_dev_attrs[] = { | 404 | static 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 | }; |
407 | EXPORT_SYMBOL_GPL(xenbus_dev_attrs); | 410 | |
411 | static const struct attribute_group xenbus_dev_group = { | ||
412 | .attrs = xenbus_dev_attrs, | ||
413 | }; | ||
414 | |||
415 | const struct attribute_group *xenbus_dev_groups[] = { | ||
416 | &xenbus_dev_group, | ||
417 | NULL, | ||
418 | }; | ||
419 | EXPORT_SYMBOL_GPL(xenbus_dev_groups); | ||
408 | 420 | ||
409 | int xenbus_probe_node(struct xen_bus_type *bus, | 421 | int 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 | ||
57 | extern struct device_attribute xenbus_dev_attrs[]; | 57 | extern const struct attribute_group *xenbus_dev_groups[]; |
58 | 58 | ||
59 | extern int xenbus_match(struct device *_dev, struct device_driver *_drv); | 59 | extern int xenbus_match(struct device *_dev, struct device_driver *_drv); |
60 | extern int xenbus_dev_probe(struct device *_dev); | 60 | extern 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 | }, |