Commit 0478b83a authored by Cornelia Huck's avatar Cornelia Huck Committed by Greg Kroah-Hartman

zfcp: Use device_driver default attribute groups.

CC: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5b88feb1
...@@ -52,6 +52,9 @@ static struct ccw_driver zfcp_ccw_driver = { ...@@ -52,6 +52,9 @@ static struct ccw_driver zfcp_ccw_driver = {
.set_offline = zfcp_ccw_set_offline, .set_offline = zfcp_ccw_set_offline,
.notify = zfcp_ccw_notify, .notify = zfcp_ccw_notify,
.shutdown = zfcp_ccw_shutdown, .shutdown = zfcp_ccw_shutdown,
.driver = {
.groups = zfcp_driver_attr_groups,
},
}; };
MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id); MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id);
...@@ -251,16 +254,7 @@ zfcp_ccw_notify(struct ccw_device *ccw_device, int event) ...@@ -251,16 +254,7 @@ zfcp_ccw_notify(struct ccw_device *ccw_device, int event)
int __init int __init
zfcp_ccw_register(void) zfcp_ccw_register(void)
{ {
int retval; return ccw_driver_register(&zfcp_ccw_driver);
retval = ccw_driver_register(&zfcp_ccw_driver);
if (retval)
goto out;
retval = zfcp_sysfs_driver_create_files(&zfcp_ccw_driver.driver);
if (retval)
ccw_driver_unregister(&zfcp_ccw_driver);
out:
return retval;
} }
/** /**
......
...@@ -27,8 +27,7 @@ ...@@ -27,8 +27,7 @@
extern struct zfcp_data zfcp_data; extern struct zfcp_data zfcp_data;
/******************************** SYSFS *************************************/ /******************************** SYSFS *************************************/
extern int zfcp_sysfs_driver_create_files(struct device_driver *); extern struct attribute_group *zfcp_driver_attr_groups[];
extern void zfcp_sysfs_driver_remove_files(struct device_driver *);
extern int zfcp_sysfs_adapter_create_files(struct device *); extern int zfcp_sysfs_adapter_create_files(struct device *);
extern void zfcp_sysfs_adapter_remove_files(struct device *); extern void zfcp_sysfs_adapter_remove_files(struct device *);
extern int zfcp_sysfs_port_create_files(struct device *, u32); extern int zfcp_sysfs_port_create_files(struct device *, u32);
......
...@@ -98,28 +98,9 @@ static struct attribute_group zfcp_driver_attr_group = { ...@@ -98,28 +98,9 @@ static struct attribute_group zfcp_driver_attr_group = {
.attrs = zfcp_driver_attrs, .attrs = zfcp_driver_attrs,
}; };
/** struct attribute_group *zfcp_driver_attr_groups[] = {
* zfcp_sysfs_create_driver_files - create sysfs driver files &zfcp_driver_attr_group,
* @dev: pointer to belonging device NULL,
* };
* Create all sysfs attributes of the zfcp device driver
*/
int
zfcp_sysfs_driver_create_files(struct device_driver *drv)
{
return sysfs_create_group(&drv->kobj, &zfcp_driver_attr_group);
}
/**
* zfcp_sysfs_remove_driver_files - remove sysfs driver files
* @dev: pointer to belonging device
*
* Remove all sysfs attributes of the zfcp device driver
*/
void
zfcp_sysfs_driver_remove_files(struct device_driver *drv)
{
sysfs_remove_group(&drv->kobj, &zfcp_driver_attr_group);
}
#undef ZFCP_LOG_AREA #undef ZFCP_LOG_AREA
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment