Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[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: Frank Pavlic <fpavlic@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>

authored by

Frank Pavlic and committed by
Jeff Garzik
8b98a37c f956b690

+39 -20
+39 -20
drivers/s390/net/qeth_main.c
··· 7344 7344 QETH_DBF_TEXT(trace,3,"setrtg6"); 7345 7345 #ifdef CONFIG_QETH_IPV6 7346 7346 7347 + if (!qeth_is_supported(card, IPA_IPV6)) 7348 + return 0; 7347 7349 qeth_correct_routing_type(card, &card->options.route6.type, 7348 7350 QETH_PROT_IPV6); 7349 7351 ··· 8546 8544 static void 8547 8545 qeth_sysfs_unregister(void) 8548 8546 { 8547 + s390_root_dev_unregister(qeth_root_dev); 8549 8548 qeth_remove_driver_attributes(); 8550 8549 ccw_driver_unregister(&qeth_ccw_driver); 8551 8550 ccwgroup_driver_unregister(&qeth_ccwgroup_driver); 8552 - s390_root_dev_unregister(qeth_root_dev); 8553 8551 } 8552 + 8554 8553 /** 8555 8554 * register qeth at sysfs 8556 8555 */ 8557 8556 static int 8558 8557 qeth_sysfs_register(void) 8559 8558 { 8560 - int rc=0; 8559 + int rc; 8561 8560 8562 8561 rc = ccwgroup_driver_register(&qeth_ccwgroup_driver); 8563 8562 if (rc) 8564 - return rc; 8563 + goto out; 8564 + 8565 8565 rc = ccw_driver_register(&qeth_ccw_driver); 8566 8566 if (rc) 8567 - return rc; 8567 + goto out_ccw_driver; 8568 + 8568 8569 rc = qeth_create_driver_attributes(); 8569 8570 if (rc) 8570 - return rc; 8571 + goto out_qeth_attr; 8572 + 8571 8573 qeth_root_dev = s390_root_dev_register("qeth"); 8572 - if (IS_ERR(qeth_root_dev)) { 8573 - rc = PTR_ERR(qeth_root_dev); 8574 - return rc; 8575 - } 8576 - return 0; 8574 + rc = IS_ERR(qeth_root_dev) ? PTR_ERR(qeth_root_dev) : 0; 8575 + if (!rc) 8576 + goto out; 8577 + 8578 + qeth_remove_driver_attributes(); 8579 + out_qeth_attr: 8580 + ccw_driver_unregister(&qeth_ccw_driver); 8581 + out_ccw_driver: 8582 + ccwgroup_driver_unregister(&qeth_ccwgroup_driver); 8583 + out: 8584 + return rc; 8577 8585 } 8578 8586 8579 8587 /*** ··· 8592 8580 static int __init 8593 8581 qeth_init(void) 8594 8582 { 8595 - int rc=0; 8583 + int rc; 8596 8584 8597 8585 PRINT_INFO("loading %s\n", version); 8598 8586 ··· 8601 8589 spin_lock_init(&qeth_notify_lock); 8602 8590 rwlock_init(&qeth_card_list.rwlock); 8603 8591 8604 - if (qeth_register_dbf_views()) 8592 + rc = qeth_register_dbf_views(); 8593 + if (rc) 8605 8594 goto out_err; 8606 - if (qeth_sysfs_register()) 8607 - goto out_sysfs; 8595 + 8596 + rc = qeth_sysfs_register(); 8597 + if (rc) 8598 + goto out_dbf; 8608 8599 8609 8600 #ifdef CONFIG_QETH_IPV6 8610 - if (qeth_ipv6_init()) { 8611 - PRINT_ERR("Out of memory during ipv6 init.\n"); 8601 + rc = qeth_ipv6_init(); 8602 + if (rc) { 8603 + PRINT_ERR("Out of memory during ipv6 init code = %d\n", rc); 8612 8604 goto out_sysfs; 8613 8605 } 8614 8606 #endif /* QETH_IPV6 */ 8615 - if (qeth_register_notifiers()) 8607 + rc = qeth_register_notifiers(); 8608 + if (rc) 8616 8609 goto out_ipv6; 8617 - if (qeth_create_procfs_entries()) 8610 + rc = qeth_create_procfs_entries(); 8611 + if (rc) 8618 8612 goto out_notifiers; 8619 8613 8620 8614 return rc; ··· 8630 8612 out_ipv6: 8631 8613 #ifdef CONFIG_QETH_IPV6 8632 8614 qeth_ipv6_uninit(); 8633 - #endif /* QETH_IPV6 */ 8634 8615 out_sysfs: 8616 + #endif /* QETH_IPV6 */ 8635 8617 qeth_sysfs_unregister(); 8618 + out_dbf: 8636 8619 qeth_unregister_dbf_views(); 8637 8620 out_err: 8638 - PRINT_ERR("Initialization failed"); 8621 + PRINT_ERR("Initialization failed with code %d\n", rc); 8639 8622 return rc; 8640 8623 } 8641 8624