diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-07 02:55:45 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-16 21:36:02 -0400 |
commit | fdcf4f8159a2cde865732ac4f47f338e91e41fcc (patch) | |
tree | 4528bc2487651ee42dc3505725c399741985ded8 /drivers/bcma/main.c | |
parent | 1b604039a342a4ba465d37657bec55db476506b0 (diff) |
bcma: 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 bcma bus code to use the
correct field.
Acked-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/bcma/main.c')
-rw-r--r-- | drivers/bcma/main.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c index 90ee350442a9..e15430a82e90 100644 --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c | |||
@@ -30,28 +30,37 @@ static ssize_t manuf_show(struct device *dev, struct device_attribute *attr, cha | |||
30 | struct bcma_device *core = container_of(dev, struct bcma_device, dev); | 30 | struct bcma_device *core = container_of(dev, struct bcma_device, dev); |
31 | return sprintf(buf, "0x%03X\n", core->id.manuf); | 31 | return sprintf(buf, "0x%03X\n", core->id.manuf); |
32 | } | 32 | } |
33 | static DEVICE_ATTR_RO(manuf); | ||
34 | |||
33 | static ssize_t id_show(struct device *dev, struct device_attribute *attr, char *buf) | 35 | static ssize_t id_show(struct device *dev, struct device_attribute *attr, char *buf) |
34 | { | 36 | { |
35 | struct bcma_device *core = container_of(dev, struct bcma_device, dev); | 37 | struct bcma_device *core = container_of(dev, struct bcma_device, dev); |
36 | return sprintf(buf, "0x%03X\n", core->id.id); | 38 | return sprintf(buf, "0x%03X\n", core->id.id); |
37 | } | 39 | } |
40 | static DEVICE_ATTR_RO(id); | ||
41 | |||
38 | static ssize_t rev_show(struct device *dev, struct device_attribute *attr, char *buf) | 42 | static ssize_t rev_show(struct device *dev, struct device_attribute *attr, char *buf) |
39 | { | 43 | { |
40 | struct bcma_device *core = container_of(dev, struct bcma_device, dev); | 44 | struct bcma_device *core = container_of(dev, struct bcma_device, dev); |
41 | return sprintf(buf, "0x%02X\n", core->id.rev); | 45 | return sprintf(buf, "0x%02X\n", core->id.rev); |
42 | } | 46 | } |
47 | static DEVICE_ATTR_RO(rev); | ||
48 | |||
43 | static ssize_t class_show(struct device *dev, struct device_attribute *attr, char *buf) | 49 | static ssize_t class_show(struct device *dev, struct device_attribute *attr, char *buf) |
44 | { | 50 | { |
45 | struct bcma_device *core = container_of(dev, struct bcma_device, dev); | 51 | struct bcma_device *core = container_of(dev, struct bcma_device, dev); |
46 | return sprintf(buf, "0x%X\n", core->id.class); | 52 | return sprintf(buf, "0x%X\n", core->id.class); |
47 | } | 53 | } |
48 | static struct device_attribute bcma_device_attrs[] = { | 54 | static DEVICE_ATTR_RO(class); |
49 | __ATTR_RO(manuf), | 55 | |
50 | __ATTR_RO(id), | 56 | static struct attribute *bcma_device_attrs[] = { |
51 | __ATTR_RO(rev), | 57 | &dev_attr_manuf.attr, |
52 | __ATTR_RO(class), | 58 | &dev_attr_id.attr, |
53 | __ATTR_NULL, | 59 | &dev_attr_rev.attr, |
60 | &dev_attr_class.attr, | ||
61 | NULL, | ||
54 | }; | 62 | }; |
63 | ATTRIBUTE_GROUPS(bcma_device); | ||
55 | 64 | ||
56 | static struct bus_type bcma_bus_type = { | 65 | static struct bus_type bcma_bus_type = { |
57 | .name = "bcma", | 66 | .name = "bcma", |
@@ -59,7 +68,7 @@ static struct bus_type bcma_bus_type = { | |||
59 | .probe = bcma_device_probe, | 68 | .probe = bcma_device_probe, |
60 | .remove = bcma_device_remove, | 69 | .remove = bcma_device_remove, |
61 | .uevent = bcma_device_uevent, | 70 | .uevent = bcma_device_uevent, |
62 | .dev_attrs = bcma_device_attrs, | 71 | .dev_groups = bcma_device_groups, |
63 | }; | 72 | }; |
64 | 73 | ||
65 | static u16 bcma_cc_core_id(struct bcma_bus *bus) | 74 | static u16 bcma_cc_core_id(struct bcma_bus *bus) |