Skip to content

Commit b785464

Browse files
committed
memstick: 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 memstick bus code to use the correct field. Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 06cf261 commit b785464

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎drivers/memstick/core/memstick.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,24 +153,24 @@ static ssize_t name##_show(struct device *dev, struct device_attribute *attr, \
153153
struct memstick_dev *card = container_of(dev, struct memstick_dev, \
154154
dev); \
155155
return sprintf(buf, format, card->id.name); \
156-
}
156+
} \
157+
static DEVICE_ATTR_RO(name);
157158

158159
MEMSTICK_ATTR(type, "%02X");
159160
MEMSTICK_ATTR(category, "%02X");
160161
MEMSTICK_ATTR(class, "%02X");
161162

162-
#define MEMSTICK_ATTR_RO(name) __ATTR(name, S_IRUGO, name##_show, NULL)
163-
164-
static struct device_attribute memstick_dev_attrs[] = {
165-
MEMSTICK_ATTR_RO(type),
166-
MEMSTICK_ATTR_RO(category),
167-
MEMSTICK_ATTR_RO(class),
168-
__ATTR_NULL
163+
static struct attribute *memstick_dev_attrs[] = {
164+
&dev_attr_type.attr,
165+
&dev_attr_category.attr,
166+
&dev_attr_class.attr,
167+
NULL,
169168
};
169+
ATTRIBUTE_GROUPS(memstick_dev);
170170

171171
static struct bus_type memstick_bus_type = {
172172
.name = "memstick",
173-
.dev_attrs = memstick_dev_attrs,
173+
.dev_groups = memstick_dev_groups,
174174
.match = memstick_bus_match,
175175
.uevent = memstick_uevent,
176176
.probe = memstick_device_probe,

0 commit comments

Comments
 (0)