diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-02-14 12:24:09 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-17 15:10:49 +0900 |
commit | 87e715deb8e24bf1a6a9a1babaf465c28c93889c (patch) | |
tree | 301f21d1a648dc9a84c1eb65df4c2e77fc79cb4a /drivers/zorro/zorro-driver.c | |
parent | a553910fbaafbd7c18823c0f1e5dcc2d12c9fd2a (diff) | |
download | blackbird-op-linux-87e715deb8e24bf1a6a9a1babaf465c28c93889c.tar.gz blackbird-op-linux-87e715deb8e24bf1a6a9a1babaf465c28c93889c.zip |
zorro: stop creating attributes by hand
Instead of creating attributes one by one, define attribute_group array
and attach it to bus->dev_groups, so that all needed attributes are created
automatically when a new device is registered on the bus.
Also switch to using standard DEVICE_ATTR_RO() macros.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/zorro/zorro-driver.c')
-rw-r--r-- | drivers/zorro/zorro-driver.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/zorro/zorro-driver.c b/drivers/zorro/zorro-driver.c index eacae1434b73..fa23b7366b98 100644 --- a/drivers/zorro/zorro-driver.c +++ b/drivers/zorro/zorro-driver.c @@ -14,6 +14,8 @@ #include <linux/module.h> #include <linux/zorro.h> +#include "zorro.h" + /** * zorro_match_device - Tell if a Zorro device structure has a matching @@ -161,12 +163,13 @@ static int zorro_uevent(struct device *dev, struct kobj_uevent_env *env) } struct bus_type zorro_bus_type = { - .name = "zorro", - .dev_name = "zorro", - .match = zorro_bus_match, - .uevent = zorro_uevent, - .probe = zorro_device_probe, - .remove = zorro_device_remove, + .name = "zorro", + .dev_name = "zorro", + .dev_groups = zorro_device_attribute_groups, + .match = zorro_bus_match, + .uevent = zorro_uevent, + .probe = zorro_device_probe, + .remove = zorro_device_remove, }; EXPORT_SYMBOL(zorro_bus_type); |