diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2012-05-15 12:07:04 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-05-16 08:42:50 -0400 |
commit | f47e22563fcf224411c5460dde6a56a22a602548 (patch) | |
tree | 795d6b35715336983c8268539c2189501b42c348 /drivers/s390/net | |
parent | a43f8de6723cbf0016d530998b9d43498156c9d0 (diff) |
s390/qeth: cleanup drv attr usage
Cleanup attributes of the qeth ccwgroup driver. Ensure availability
of driver attributes by the time the driver is registered.
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/net')
-rw-r--r-- | drivers/s390/net/qeth_core_main.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index d1c87420edf3..a628f56ae576 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c | |||
@@ -5291,6 +5291,18 @@ static ssize_t qeth_core_driver_group_store(struct device_driver *ddrv, | |||
5291 | } | 5291 | } |
5292 | static DRIVER_ATTR(group, 0200, NULL, qeth_core_driver_group_store); | 5292 | static DRIVER_ATTR(group, 0200, NULL, qeth_core_driver_group_store); |
5293 | 5293 | ||
5294 | static struct attribute *qeth_drv_attrs[] = { | ||
5295 | &driver_attr_group.attr, | ||
5296 | NULL, | ||
5297 | }; | ||
5298 | static struct attribute_group qeth_drv_attr_group = { | ||
5299 | .attrs = qeth_drv_attrs, | ||
5300 | }; | ||
5301 | static const struct attribute_group *qeth_drv_attr_groups[] = { | ||
5302 | &qeth_drv_attr_group, | ||
5303 | NULL, | ||
5304 | }; | ||
5305 | |||
5294 | static struct { | 5306 | static struct { |
5295 | const char str[ETH_GSTRING_LEN]; | 5307 | const char str[ETH_GSTRING_LEN]; |
5296 | } qeth_ethtool_stats_keys[] = { | 5308 | } qeth_ethtool_stats_keys[] = { |
@@ -5531,13 +5543,10 @@ static int __init qeth_core_init(void) | |||
5531 | rc = ccw_driver_register(&qeth_ccw_driver); | 5543 | rc = ccw_driver_register(&qeth_ccw_driver); |
5532 | if (rc) | 5544 | if (rc) |
5533 | goto ccw_err; | 5545 | goto ccw_err; |
5546 | qeth_core_ccwgroup_driver.driver.groups = qeth_drv_attr_groups; | ||
5534 | rc = ccwgroup_driver_register(&qeth_core_ccwgroup_driver); | 5547 | rc = ccwgroup_driver_register(&qeth_core_ccwgroup_driver); |
5535 | if (rc) | 5548 | if (rc) |
5536 | goto ccwgroup_err; | 5549 | goto ccwgroup_err; |
5537 | rc = driver_create_file(&qeth_core_ccwgroup_driver.driver, | ||
5538 | &driver_attr_group); | ||
5539 | if (rc) | ||
5540 | goto driver_err; | ||
5541 | qeth_core_root_dev = root_device_register("qeth"); | 5550 | qeth_core_root_dev = root_device_register("qeth"); |
5542 | rc = IS_ERR(qeth_core_root_dev) ? PTR_ERR(qeth_core_root_dev) : 0; | 5551 | rc = IS_ERR(qeth_core_root_dev) ? PTR_ERR(qeth_core_root_dev) : 0; |
5543 | if (rc) | 5552 | if (rc) |
@@ -5563,9 +5572,6 @@ cqslab_err: | |||
5563 | slab_err: | 5572 | slab_err: |
5564 | root_device_unregister(qeth_core_root_dev); | 5573 | root_device_unregister(qeth_core_root_dev); |
5565 | register_err: | 5574 | register_err: |
5566 | driver_remove_file(&qeth_core_ccwgroup_driver.driver, | ||
5567 | &driver_attr_group); | ||
5568 | driver_err: | ||
5569 | ccwgroup_driver_unregister(&qeth_core_ccwgroup_driver); | 5575 | ccwgroup_driver_unregister(&qeth_core_ccwgroup_driver); |
5570 | ccwgroup_err: | 5576 | ccwgroup_err: |
5571 | ccw_driver_unregister(&qeth_ccw_driver); | 5577 | ccw_driver_unregister(&qeth_ccw_driver); |
@@ -5580,8 +5586,6 @@ out_err: | |||
5580 | static void __exit qeth_core_exit(void) | 5586 | static void __exit qeth_core_exit(void) |
5581 | { | 5587 | { |
5582 | root_device_unregister(qeth_core_root_dev); | 5588 | root_device_unregister(qeth_core_root_dev); |
5583 | driver_remove_file(&qeth_core_ccwgroup_driver.driver, | ||
5584 | &driver_attr_group); | ||
5585 | ccwgroup_driver_unregister(&qeth_core_ccwgroup_driver); | 5589 | ccwgroup_driver_unregister(&qeth_core_ccwgroup_driver); |
5586 | ccw_driver_unregister(&qeth_ccw_driver); | 5590 | ccw_driver_unregister(&qeth_ccw_driver); |
5587 | kmem_cache_destroy(qeth_qdio_outbuf_cache); | 5591 | kmem_cache_destroy(qeth_qdio_outbuf_cache); |