mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 15:19:51 +00:00
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>
This commit is contained in:
parent
06cf261bf4
commit
b785464bdb
@ -153,24 +153,24 @@ static ssize_t name##_show(struct device *dev, struct device_attribute *attr, \
|
|||||||
struct memstick_dev *card = container_of(dev, struct memstick_dev, \
|
struct memstick_dev *card = container_of(dev, struct memstick_dev, \
|
||||||
dev); \
|
dev); \
|
||||||
return sprintf(buf, format, card->id.name); \
|
return sprintf(buf, format, card->id.name); \
|
||||||
}
|
} \
|
||||||
|
static DEVICE_ATTR_RO(name);
|
||||||
|
|
||||||
MEMSTICK_ATTR(type, "%02X");
|
MEMSTICK_ATTR(type, "%02X");
|
||||||
MEMSTICK_ATTR(category, "%02X");
|
MEMSTICK_ATTR(category, "%02X");
|
||||||
MEMSTICK_ATTR(class, "%02X");
|
MEMSTICK_ATTR(class, "%02X");
|
||||||
|
|
||||||
#define MEMSTICK_ATTR_RO(name) __ATTR(name, S_IRUGO, name##_show, NULL)
|
static struct attribute *memstick_dev_attrs[] = {
|
||||||
|
&dev_attr_type.attr,
|
||||||
static struct device_attribute memstick_dev_attrs[] = {
|
&dev_attr_category.attr,
|
||||||
MEMSTICK_ATTR_RO(type),
|
&dev_attr_class.attr,
|
||||||
MEMSTICK_ATTR_RO(category),
|
NULL,
|
||||||
MEMSTICK_ATTR_RO(class),
|
|
||||||
__ATTR_NULL
|
|
||||||
};
|
};
|
||||||
|
ATTRIBUTE_GROUPS(memstick_dev);
|
||||||
|
|
||||||
static struct bus_type memstick_bus_type = {
|
static struct bus_type memstick_bus_type = {
|
||||||
.name = "memstick",
|
.name = "memstick",
|
||||||
.dev_attrs = memstick_dev_attrs,
|
.dev_groups = memstick_dev_groups,
|
||||||
.match = memstick_bus_match,
|
.match = memstick_bus_match,
|
||||||
.uevent = memstick_uevent,
|
.uevent = memstick_uevent,
|
||||||
.probe = memstick_device_probe,
|
.probe = memstick_device_probe,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user