diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-08 15:22:56 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-12 15:33:31 -0700 |
commit | ed0617b5c0bcd7fd04053568aa0cc19a977a1f26 (patch) | |
tree | 8b5a0a83d4374fc9d6361cbb9f820300c446d7ca /drivers/base/bus.c | |
parent | fa6fdb33b486a8afc5439c504da8d581e142c77d (diff) | |
download | linux-stable-ed0617b5c0bcd7fd04053568aa0cc19a977a1f26.tar.gz linux-stable-ed0617b5c0bcd7fd04053568aa0cc19a977a1f26.tar.bz2 linux-stable-ed0617b5c0bcd7fd04053568aa0cc19a977a1f26.zip |
driver core: bus_type: add drv_groups
attribute groups are much more flexible than just a list of attributes,
due to their support for visibility of the attributes, and binary
attributes. Add drv_groups to struct bus_type which should be used
instead of drv_attrs.
drv_attrs will be removed from the structure soon.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/bus.c')
-rw-r--r-- | drivers/base/bus.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 7b2dc5ba7d79..de5ce22df306 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -725,6 +725,10 @@ int bus_add_driver(struct device_driver *drv) printk(KERN_ERR "%s: driver_add_attrs(%s) failed\n", __func__, drv->name); } + error = driver_add_groups(drv, bus->drv_groups); + if (error) + printk(KERN_ERR "%s: driver_create_groups(%s) failed\n", + __func__, drv->name); if (!drv->suppress_bind_attrs) { error = add_bind_files(drv); @@ -762,6 +766,7 @@ void bus_remove_driver(struct device_driver *drv) if (!drv->suppress_bind_attrs) remove_bind_files(drv); driver_remove_attrs(drv->bus, drv); + driver_remove_groups(drv, drv->bus->drv_groups); driver_remove_file(drv, &driver_attr_uevent); klist_remove(&drv->p->knode_bus); pr_debug("bus: '%s': remove driver %s\n", drv->bus->name, drv->name); |