From 87e715deb8e24bf1a6a9a1babaf465c28c93889c Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Tue, 14 Feb 2017 12:24:09 -0800 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/zorro/zorro-driver.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'drivers/zorro/zorro-driver.c') 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 #include +#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); -- cgit v1.2.3