Commit 8b98a37c authored by Frank Pavlic's avatar Frank Pavlic Committed by Jeff Garzik

[PATCH] s390: qeth driver fixes [6/6]

[PATCH 9/9] s390: qeth driver fixes [6/6]

From: Frank Pavlic <fpavlic@de.ibm.com>
	- Hipersockets has no IPV6 support, thus prevent issueing
	  SETRTG_IPV6 control commands on Hipersockets devices.
	- fixed error handling in qeth_sysfs_(un)register
Signed-off-by: default avatarFrank Pavlic <fpavlic@de.ibm.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent f956b690
...@@ -7344,6 +7344,8 @@ qeth_setrouting_v6(struct qeth_card *card) ...@@ -7344,6 +7344,8 @@ qeth_setrouting_v6(struct qeth_card *card)
QETH_DBF_TEXT(trace,3,"setrtg6"); QETH_DBF_TEXT(trace,3,"setrtg6");
#ifdef CONFIG_QETH_IPV6 #ifdef CONFIG_QETH_IPV6
if (!qeth_is_supported(card, IPA_IPV6))
return 0;
qeth_correct_routing_type(card, &card->options.route6.type, qeth_correct_routing_type(card, &card->options.route6.type,
QETH_PROT_IPV6); QETH_PROT_IPV6);
...@@ -8544,34 +8546,44 @@ qeth_ipv6_uninit(void) ...@@ -8544,34 +8546,44 @@ qeth_ipv6_uninit(void)
static void static void
qeth_sysfs_unregister(void) qeth_sysfs_unregister(void)
{ {
s390_root_dev_unregister(qeth_root_dev);
qeth_remove_driver_attributes(); qeth_remove_driver_attributes();
ccw_driver_unregister(&qeth_ccw_driver); ccw_driver_unregister(&qeth_ccw_driver);
ccwgroup_driver_unregister(&qeth_ccwgroup_driver); ccwgroup_driver_unregister(&qeth_ccwgroup_driver);
s390_root_dev_unregister(qeth_root_dev);
} }
/** /**
* register qeth at sysfs * register qeth at sysfs
*/ */
static int static int
qeth_sysfs_register(void) qeth_sysfs_register(void)
{ {
int rc=0; int rc;
rc = ccwgroup_driver_register(&qeth_ccwgroup_driver); rc = ccwgroup_driver_register(&qeth_ccwgroup_driver);
if (rc) if (rc)
return rc; goto out;
rc = ccw_driver_register(&qeth_ccw_driver); rc = ccw_driver_register(&qeth_ccw_driver);
if (rc) if (rc)
return rc; goto out_ccw_driver;
rc = qeth_create_driver_attributes(); rc = qeth_create_driver_attributes();
if (rc) if (rc)
return rc; goto out_qeth_attr;
qeth_root_dev = s390_root_dev_register("qeth"); qeth_root_dev = s390_root_dev_register("qeth");
if (IS_ERR(qeth_root_dev)) { rc = IS_ERR(qeth_root_dev) ? PTR_ERR(qeth_root_dev) : 0;
rc = PTR_ERR(qeth_root_dev); if (!rc)
return rc; goto out;
}
return 0; qeth_remove_driver_attributes();
out_qeth_attr:
ccw_driver_unregister(&qeth_ccw_driver);
out_ccw_driver:
ccwgroup_driver_unregister(&qeth_ccwgroup_driver);
out:
return rc;
} }
/*** /***
...@@ -8580,7 +8592,7 @@ qeth_sysfs_register(void) ...@@ -8580,7 +8592,7 @@ qeth_sysfs_register(void)
static int __init static int __init
qeth_init(void) qeth_init(void)
{ {
int rc=0; int rc;
PRINT_INFO("loading %s\n", version); PRINT_INFO("loading %s\n", version);
...@@ -8589,20 +8601,26 @@ qeth_init(void) ...@@ -8589,20 +8601,26 @@ qeth_init(void)
spin_lock_init(&qeth_notify_lock); spin_lock_init(&qeth_notify_lock);
rwlock_init(&qeth_card_list.rwlock); rwlock_init(&qeth_card_list.rwlock);
if (qeth_register_dbf_views()) rc = qeth_register_dbf_views();
if (rc)
goto out_err; goto out_err;
if (qeth_sysfs_register())
goto out_sysfs; rc = qeth_sysfs_register();
if (rc)
goto out_dbf;
#ifdef CONFIG_QETH_IPV6 #ifdef CONFIG_QETH_IPV6
if (qeth_ipv6_init()) { rc = qeth_ipv6_init();
PRINT_ERR("Out of memory during ipv6 init.\n"); if (rc) {
PRINT_ERR("Out of memory during ipv6 init code = %d\n", rc);
goto out_sysfs; goto out_sysfs;
} }
#endif /* QETH_IPV6 */ #endif /* QETH_IPV6 */
if (qeth_register_notifiers()) rc = qeth_register_notifiers();
if (rc)
goto out_ipv6; goto out_ipv6;
if (qeth_create_procfs_entries()) rc = qeth_create_procfs_entries();
if (rc)
goto out_notifiers; goto out_notifiers;
return rc; return rc;
...@@ -8612,12 +8630,13 @@ qeth_init(void) ...@@ -8612,12 +8630,13 @@ qeth_init(void)
out_ipv6: out_ipv6:
#ifdef CONFIG_QETH_IPV6 #ifdef CONFIG_QETH_IPV6
qeth_ipv6_uninit(); qeth_ipv6_uninit();
#endif /* QETH_IPV6 */
out_sysfs: out_sysfs:
#endif /* QETH_IPV6 */
qeth_sysfs_unregister(); qeth_sysfs_unregister();
out_dbf:
qeth_unregister_dbf_views(); qeth_unregister_dbf_views();
out_err: out_err:
PRINT_ERR("Initialization failed"); PRINT_ERR("Initialization failed with code %d\n", rc);
return rc; return rc;
} }
......
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