diff options
| author | Dmitry Torokhov <dtor_core@ameritech.net> | 2004-07-19 13:16:28 -0500 |
|---|---|---|
| committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2004-07-19 13:16:28 -0500 |
| commit | 26ecd16b6ac0721b8b3e4084aaaebdf7b65bd9f9 (patch) | |
| tree | cd93145367dd80ac4621bd12744130228bed011b /drivers/input | |
| parent | fe8bc20230475ed2ae5ddfe69489eeab576e6465 (diff) | |
Input: Switch to use bus' default device and driver attributes to
manage serio sysfs attributes
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
| -rw-r--r-- | drivers/input/serio/serio.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index 36de6c228355..0751baaa0f8a 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c @@ -245,7 +245,6 @@ static ssize_t serio_show_description(struct device *dev, char *buf) struct serio *serio = to_serio_port(dev); return sprintf(buf, "%s\n", serio->name); } -static DEVICE_ATTR(description, S_IRUGO, serio_show_description, NULL); static ssize_t serio_show_driver(struct device *dev, char *buf) { @@ -283,7 +282,13 @@ static ssize_t serio_rebind_driver(struct device *dev, const char *buf, size_t c return retval; } -static DEVICE_ATTR(driver, S_IWUSR | S_IRUGO, serio_show_driver, serio_rebind_driver); + +static struct device_attribute serio_device_attrs[] = { + __ATTR(description, S_IRUGO, serio_show_description, NULL), + __ATTR(driver, S_IWUSR | S_IRUGO, serio_show_driver, serio_rebind_driver), + __ATTR_NULL +}; + static void serio_release_port(struct device *dev) { @@ -305,8 +310,6 @@ static void serio_create_port(struct serio *serio) if (serio->parent) serio->dev.parent = &serio->parent->dev; device_register(&serio->dev); - device_create_file(&serio->dev, &dev_attr_description); - device_create_file(&serio->dev, &dev_attr_driver); } /* @@ -481,7 +484,11 @@ static ssize_t serio_driver_show_description(struct device_driver *drv, char *bu struct serio_driver *driver = to_serio_driver(drv); return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)"); } -static DRIVER_ATTR(description, S_IRUGO, serio_driver_show_description, NULL); + +static struct driver_attribute serio_driver_attrs[] = { + __ATTR(description, S_IRUGO, serio_driver_show_description, NULL), + __ATTR_NULL +}; void serio_register_driver(struct serio_driver *drv) { @@ -493,7 +500,6 @@ void serio_register_driver(struct serio_driver *drv) drv->driver.bus = &serio_bus; driver_register(&drv->driver); - driver_create_file(&drv->driver, &driver_attr_description); if (drv->manual_bind) goto out; @@ -597,6 +603,8 @@ static int __init serio_init(void) return -1; } + serio_bus.dev_attrs = serio_device_attrs; + serio_bus.drv_attrs = serio_driver_attrs; bus_register(&serio_bus); return 0; |
