diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2007-07-30 02:28:56 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 14:50:59 -0700 |
commit | 8380770c842faef3001e44662953d64ad9a93663 (patch) | |
tree | 631ce7dae6fe0edb36942e6165f679638f6beb68 /drivers/base | |
parent | 3b6662f192fc521b9657f63e68d20ec99979dae6 (diff) | |
download | blackbird-op-linux-8380770c842faef3001e44662953d64ad9a93663.tar.gz blackbird-op-linux-8380770c842faef3001e44662953d64ad9a93663.zip |
Driver core: make sysfs uevent-attributes static
Attributes do not have an owner(module) anymore, so there is no need
to carry the attributes in every single bus instance.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Acked-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/bus.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 61c67526a656..ff850d1b0d92 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -568,32 +568,29 @@ static void remove_bind_files(struct device_driver *drv) driver_remove_file(drv, &driver_attr_unbind); } +static BUS_ATTR(drivers_probe, S_IWUSR, NULL, store_drivers_probe); +static BUS_ATTR(drivers_autoprobe, S_IWUSR | S_IRUGO, + show_drivers_autoprobe, store_drivers_autoprobe); + static int add_probe_files(struct bus_type *bus) { int retval; - bus->drivers_probe_attr.attr.name = "drivers_probe"; - bus->drivers_probe_attr.attr.mode = S_IWUSR; - bus->drivers_probe_attr.store = store_drivers_probe; - retval = bus_create_file(bus, &bus->drivers_probe_attr); + retval = bus_create_file(bus, &bus_attr_drivers_probe); if (retval) goto out; - bus->drivers_autoprobe_attr.attr.name = "drivers_autoprobe"; - bus->drivers_autoprobe_attr.attr.mode = S_IWUSR | S_IRUGO; - bus->drivers_autoprobe_attr.show = show_drivers_autoprobe; - bus->drivers_autoprobe_attr.store = store_drivers_autoprobe; - retval = bus_create_file(bus, &bus->drivers_autoprobe_attr); + retval = bus_create_file(bus, &bus_attr_drivers_autoprobe); if (retval) - bus_remove_file(bus, &bus->drivers_probe_attr); + bus_remove_file(bus, &bus_attr_drivers_probe); out: return retval; } static void remove_probe_files(struct bus_type *bus) { - bus_remove_file(bus, &bus->drivers_autoprobe_attr); - bus_remove_file(bus, &bus->drivers_probe_attr); + bus_remove_file(bus, &bus_attr_drivers_autoprobe); + bus_remove_file(bus, &bus_attr_drivers_probe); } #else static inline int add_bind_files(struct device_driver *drv) { return 0; } |