input: serio: remove bus usage of dev_attrs

The dev_attrs field of struct bus_type is going away soon, so move the
remaining sysfs files that are being described with this field to use
dev_groups instead.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: <linux-input@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Greg Kroah-Hartman 2013-10-07 18:09:08 -07:00
parent 7eab8ded34
commit 3778a2129b

View File

@ -365,7 +365,7 @@ static ssize_t serio_show_description(struct device *dev, struct device_attribut
return sprintf(buf, "%s\n", serio->name); return sprintf(buf, "%s\n", serio->name);
} }
static ssize_t serio_show_modalias(struct device *dev, struct device_attribute *attr, char *buf) static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf)
{ {
struct serio *serio = to_serio_port(dev); struct serio *serio = to_serio_port(dev);
@ -397,30 +397,7 @@ static ssize_t extra_show(struct device *dev, struct device_attribute *attr, cha
return sprintf(buf, "%02x\n", serio->id.extra); return sprintf(buf, "%02x\n", serio->id.extra);
} }
static DEVICE_ATTR_RO(type); static ssize_t drvctl_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
static DEVICE_ATTR_RO(proto);
static DEVICE_ATTR_RO(id);
static DEVICE_ATTR_RO(extra);
static struct attribute *serio_device_id_attrs[] = {
&dev_attr_type.attr,
&dev_attr_proto.attr,
&dev_attr_id.attr,
&dev_attr_extra.attr,
NULL
};
static struct attribute_group serio_id_attr_group = {
.name = "id",
.attrs = serio_device_id_attrs,
};
static const struct attribute_group *serio_device_attr_groups[] = {
&serio_id_attr_group,
NULL
};
static ssize_t serio_rebind_driver(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{ {
struct serio *serio = to_serio_port(dev); struct serio *serio = to_serio_port(dev);
struct device_driver *drv; struct device_driver *drv;
@ -474,14 +451,36 @@ static ssize_t serio_set_bind_mode(struct device *dev, struct device_attribute *
return retval; return retval;
} }
static struct device_attribute serio_device_attrs[] = { static DEVICE_ATTR_RO(type);
__ATTR(description, S_IRUGO, serio_show_description, NULL), static DEVICE_ATTR_RO(proto);
__ATTR(modalias, S_IRUGO, serio_show_modalias, NULL), static DEVICE_ATTR_RO(id);
__ATTR(drvctl, S_IWUSR, NULL, serio_rebind_driver), static DEVICE_ATTR_RO(extra);
__ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode), static DEVICE_ATTR_RO(modalias);
__ATTR_NULL static DEVICE_ATTR_WO(drvctl);
static DEVICE_ATTR(description, S_IRUGO, serio_show_description, NULL);
static DEVICE_ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode);
static struct attribute *serio_device_id_attrs[] = {
&dev_attr_type.attr,
&dev_attr_proto.attr,
&dev_attr_id.attr,
&dev_attr_extra.attr,
&dev_attr_modalias.attr,
&dev_attr_description.attr,
&dev_attr_drvctl.attr,
&dev_attr_bind_mode.attr,
NULL
}; };
static struct attribute_group serio_id_attr_group = {
.name = "id",
.attrs = serio_device_id_attrs,
};
static const struct attribute_group *serio_device_attr_groups[] = {
&serio_id_attr_group,
NULL
};
static void serio_release_port(struct device *dev) static void serio_release_port(struct device *dev)
{ {
@ -996,7 +995,6 @@ EXPORT_SYMBOL(serio_interrupt);
static struct bus_type serio_bus = { static struct bus_type serio_bus = {
.name = "serio", .name = "serio",
.dev_attrs = serio_device_attrs,
.drv_groups = serio_driver_groups, .drv_groups = serio_driver_groups,
.match = serio_bus_match, .match = serio_bus_match,
.uevent = serio_uevent, .uevent = serio_uevent,