diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2007-12-05 06:50:31 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:34 -0500 |
commit | 0478b83adb0269033221dc063d1185a224681ee8 (patch) | |
tree | e757835233e28fb86acda58c4b77f226924d4b0c /drivers/s390/scsi | |
parent | 5b88feb134e0a7413cb9cb6ba677943615ca56cc (diff) |
zfcp: Use device_driver default attribute groups.
CC: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r-- | drivers/s390/scsi/zfcp_ccw.c | 14 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_ext.h | 3 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_sysfs_driver.c | 27 |
3 files changed, 9 insertions, 35 deletions
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index e01cbf152a81..86c3f6539a7d 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c | |||
@@ -52,6 +52,9 @@ static struct ccw_driver zfcp_ccw_driver = { | |||
52 | .set_offline = zfcp_ccw_set_offline, | 52 | .set_offline = zfcp_ccw_set_offline, |
53 | .notify = zfcp_ccw_notify, | 53 | .notify = zfcp_ccw_notify, |
54 | .shutdown = zfcp_ccw_shutdown, | 54 | .shutdown = zfcp_ccw_shutdown, |
55 | .driver = { | ||
56 | .groups = zfcp_driver_attr_groups, | ||
57 | }, | ||
55 | }; | 58 | }; |
56 | 59 | ||
57 | MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id); | 60 | MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id); |
@@ -251,16 +254,7 @@ zfcp_ccw_notify(struct ccw_device *ccw_device, int event) | |||
251 | int __init | 254 | int __init |
252 | zfcp_ccw_register(void) | 255 | zfcp_ccw_register(void) |
253 | { | 256 | { |
254 | int retval; | 257 | return ccw_driver_register(&zfcp_ccw_driver); |
255 | |||
256 | retval = ccw_driver_register(&zfcp_ccw_driver); | ||
257 | if (retval) | ||
258 | goto out; | ||
259 | retval = zfcp_sysfs_driver_create_files(&zfcp_ccw_driver.driver); | ||
260 | if (retval) | ||
261 | ccw_driver_unregister(&zfcp_ccw_driver); | ||
262 | out: | ||
263 | return retval; | ||
264 | } | 258 | } |
265 | 259 | ||
266 | /** | 260 | /** |
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index 8534cf09546c..06b1079b7f3d 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h | |||
@@ -27,8 +27,7 @@ | |||
27 | extern struct zfcp_data zfcp_data; | 27 | extern struct zfcp_data zfcp_data; |
28 | 28 | ||
29 | /******************************** SYSFS *************************************/ | 29 | /******************************** SYSFS *************************************/ |
30 | extern int zfcp_sysfs_driver_create_files(struct device_driver *); | 30 | extern struct attribute_group *zfcp_driver_attr_groups[]; |
31 | extern void zfcp_sysfs_driver_remove_files(struct device_driver *); | ||
32 | extern int zfcp_sysfs_adapter_create_files(struct device *); | 31 | extern int zfcp_sysfs_adapter_create_files(struct device *); |
33 | extern void zfcp_sysfs_adapter_remove_files(struct device *); | 32 | extern void zfcp_sysfs_adapter_remove_files(struct device *); |
34 | extern int zfcp_sysfs_port_create_files(struct device *, u32); | 33 | extern int zfcp_sysfs_port_create_files(struct device *, u32); |
diff --git a/drivers/s390/scsi/zfcp_sysfs_driver.c b/drivers/s390/scsi/zfcp_sysfs_driver.c index 005e62f8593b..651edd58906a 100644 --- a/drivers/s390/scsi/zfcp_sysfs_driver.c +++ b/drivers/s390/scsi/zfcp_sysfs_driver.c | |||
@@ -98,28 +98,9 @@ static struct attribute_group zfcp_driver_attr_group = { | |||
98 | .attrs = zfcp_driver_attrs, | 98 | .attrs = zfcp_driver_attrs, |
99 | }; | 99 | }; |
100 | 100 | ||
101 | /** | 101 | struct attribute_group *zfcp_driver_attr_groups[] = { |
102 | * zfcp_sysfs_create_driver_files - create sysfs driver files | 102 | &zfcp_driver_attr_group, |
103 | * @dev: pointer to belonging device | 103 | NULL, |
104 | * | 104 | }; |
105 | * Create all sysfs attributes of the zfcp device driver | ||
106 | */ | ||
107 | int | ||
108 | zfcp_sysfs_driver_create_files(struct device_driver *drv) | ||
109 | { | ||
110 | return sysfs_create_group(&drv->kobj, &zfcp_driver_attr_group); | ||
111 | } | ||
112 | |||
113 | /** | ||
114 | * zfcp_sysfs_remove_driver_files - remove sysfs driver files | ||
115 | * @dev: pointer to belonging device | ||
116 | * | ||
117 | * Remove all sysfs attributes of the zfcp device driver | ||
118 | */ | ||
119 | void | ||
120 | zfcp_sysfs_driver_remove_files(struct device_driver *drv) | ||
121 | { | ||
122 | sysfs_remove_group(&drv->kobj, &zfcp_driver_attr_group); | ||
123 | } | ||
124 | 105 | ||
125 | #undef ZFCP_LOG_AREA | 106 | #undef ZFCP_LOG_AREA |