提交 7048f5d0 编写于 作者: G Greg Kroah-Hartman

Input: serio: convert bus code to use drv_groups

The drv_attrs field of struct bus_type is going away soon, drv_groups
should be used instead.  This converts the serio bus code to use the
correct field.
Acked-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 5e9e4911
...@@ -732,19 +732,20 @@ EXPORT_SYMBOL(serio_unregister_child_port); ...@@ -732,19 +732,20 @@ EXPORT_SYMBOL(serio_unregister_child_port);
* Serio driver operations * Serio driver operations
*/ */
static ssize_t serio_driver_show_description(struct device_driver *drv, char *buf) static ssize_t description_show(struct device_driver *drv, char *buf)
{ {
struct serio_driver *driver = to_serio_driver(drv); struct serio_driver *driver = to_serio_driver(drv);
return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)"); return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)");
} }
static DRIVER_ATTR_RO(description);
static ssize_t serio_driver_show_bind_mode(struct device_driver *drv, char *buf) static ssize_t bind_mode_show(struct device_driver *drv, char *buf)
{ {
struct serio_driver *serio_drv = to_serio_driver(drv); struct serio_driver *serio_drv = to_serio_driver(drv);
return sprintf(buf, "%s\n", serio_drv->manual_bind ? "manual" : "auto"); return sprintf(buf, "%s\n", serio_drv->manual_bind ? "manual" : "auto");
} }
static ssize_t serio_driver_set_bind_mode(struct device_driver *drv, const char *buf, size_t count) static ssize_t bind_mode_store(struct device_driver *drv, const char *buf, size_t count)
{ {
struct serio_driver *serio_drv = to_serio_driver(drv); struct serio_driver *serio_drv = to_serio_driver(drv);
int retval; int retval;
...@@ -760,14 +761,14 @@ static ssize_t serio_driver_set_bind_mode(struct device_driver *drv, const char ...@@ -760,14 +761,14 @@ static ssize_t serio_driver_set_bind_mode(struct device_driver *drv, const char
return retval; return retval;
} }
static DRIVER_ATTR_RW(bind_mode);
static struct attribute *serio_driver_attrs[] = {
static struct driver_attribute serio_driver_attrs[] = { &driver_attr_description.attr,
__ATTR(description, S_IRUGO, serio_driver_show_description, NULL), &driver_attr_bind_mode.attr,
__ATTR(bind_mode, S_IWUSR | S_IRUGO, NULL,
serio_driver_show_bind_mode, serio_driver_set_bind_mode),
__ATTR_NULL
}; };
ATTRIBUTE_GROUPS(serio_driver);
static int serio_driver_probe(struct device *dev) static int serio_driver_probe(struct device *dev)
{ {
...@@ -996,7 +997,7 @@ EXPORT_SYMBOL(serio_interrupt); ...@@ -996,7 +997,7 @@ 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, .dev_attrs = serio_device_attrs,
.drv_attrs = serio_driver_attrs, .drv_groups = serio_driver_groups,
.match = serio_bus_match, .match = serio_bus_match,
.uevent = serio_uevent, .uevent = serio_uevent,
.probe = serio_driver_probe, .probe = serio_driver_probe,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册