# HG changeset patch # User Florian Pose # Date 1414424003 -3600 # Node ID 87e502828b3f855c9bfefa4e6df3673b771cee0e # Parent d94281cb835a5f50cbd1d1f3c3ab06e0f0f6523f Use return value of ecdev_open(); thanks to Patrick Bruenn. diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.13-ethercat.c --- a/devices/8139too-2.6.13-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.13-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1145,9 +1145,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.17-ethercat.c --- a/devices/8139too-2.6.17-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.17-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1149,9 +1149,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.18-ethercat.c --- a/devices/8139too-2.6.18-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.18-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1150,9 +1150,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.19-ethercat.c --- a/devices/8139too-2.6.19-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.19-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1149,9 +1149,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.22-ethercat.c --- a/devices/8139too-2.6.22-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.22-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1149,9 +1149,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.23-ethercat.c --- a/devices/8139too-2.6.23-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.23-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1146,9 +1146,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.24-ethercat.c --- a/devices/8139too-2.6.24-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.24-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1139,9 +1139,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.25-ethercat.c --- a/devices/8139too-2.6.25-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.25-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1139,9 +1139,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.26-ethercat.c --- a/devices/8139too-2.6.26-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.26-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1139,9 +1139,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.27-ethercat.c --- a/devices/8139too-2.6.27-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.27-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1145,9 +1145,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.28-ethercat.c --- a/devices/8139too-2.6.28-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.28-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1145,9 +1145,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.29-ethercat.c --- a/devices/8139too-2.6.29-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.29-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1145,9 +1145,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.31-ethercat.c --- a/devices/8139too-2.6.31-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.31-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1134,9 +1134,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.32-ethercat.c --- a/devices/8139too-2.6.32-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.32-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1134,9 +1134,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.33-ethercat.c --- a/devices/8139too-2.6.33-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.33-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1134,9 +1134,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.34-ethercat.c --- a/devices/8139too-2.6.34-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.34-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1135,9 +1135,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.35-ethercat.c --- a/devices/8139too-2.6.35-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.35-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1136,9 +1136,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.36-ethercat.c --- a/devices/8139too-2.6.36-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.36-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1138,9 +1138,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-2.6.37-ethercat.c --- a/devices/8139too-2.6.37-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-2.6.37-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1140,9 +1140,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-3.0-ethercat.c --- a/devices/8139too-3.0-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-3.0-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1141,9 +1141,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-3.2-ethercat.c --- a/devices/8139too-3.2-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-3.2-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1142,9 +1142,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-3.4-ethercat.c --- a/devices/8139too-3.4-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-3.4-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1182,9 +1182,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/8139too-3.6-ethercat.c --- a/devices/8139too-3.6-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/8139too-3.6-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1156,9 +1156,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0; diff -r d94281cb835a -r 87e502828b3f devices/e100-2.6.20-ethercat.c --- a/devices/e100-2.6.20-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e100-2.6.20-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -2804,7 +2804,8 @@ // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); if (nic->ecdev) { - if (ecdev_open(nic->ecdev)) { + err = ecdev_open(nic->ecdev); + if (err) { ecdev_withdraw(nic->ecdev); goto err_out_free; } diff -r d94281cb835a -r 87e502828b3f devices/e100-2.6.24-ethercat.c --- a/devices/e100-2.6.24-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e100-2.6.24-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -2817,7 +2817,8 @@ // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); if (nic->ecdev) { - if (ecdev_open(nic->ecdev)) { + err = ecdev_open(nic->ecdev); + if (err) { ecdev_withdraw(nic->ecdev); goto err_out_free; } diff -r d94281cb835a -r 87e502828b3f devices/e100-2.6.26-ethercat.c --- a/devices/e100-2.6.26-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e100-2.6.26-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -2888,7 +2888,8 @@ // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); if (nic->ecdev) { - if (ecdev_open(nic->ecdev)) { + err = ecdev_open(nic->ecdev); + if (err) { ecdev_withdraw(nic->ecdev); goto err_out_free; } diff -r d94281cb835a -r 87e502828b3f devices/e100-2.6.27-ethercat.c --- a/devices/e100-2.6.27-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e100-2.6.27-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -2896,7 +2896,8 @@ // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); if (nic->ecdev) { - if (ecdev_open(nic->ecdev)) { + err = ecdev_open(nic->ecdev); + if (err) { ecdev_withdraw(nic->ecdev); goto err_out_free; } diff -r d94281cb835a -r 87e502828b3f devices/e100-2.6.28-ethercat.c --- a/devices/e100-2.6.28-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e100-2.6.28-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -2886,7 +2886,8 @@ // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); if (nic->ecdev) { - if (ecdev_open(nic->ecdev)) { + err = ecdev_open(nic->ecdev); + if (err) { ecdev_withdraw(nic->ecdev); goto err_out_free; } diff -r d94281cb835a -r 87e502828b3f devices/e100-2.6.29-ethercat.c --- a/devices/e100-2.6.29-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e100-2.6.29-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -2790,7 +2790,8 @@ // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); if (nic->ecdev) { - if (ecdev_open(nic->ecdev)) { + err = ecdev_open(nic->ecdev); + if (err) { ecdev_withdraw(nic->ecdev); goto err_out_free; } diff -r d94281cb835a -r 87e502828b3f devices/e100-2.6.31-ethercat.c --- a/devices/e100-2.6.31-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e100-2.6.31-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -2971,7 +2971,8 @@ // offer device to EtherCAT master module nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE); if (nic->ecdev) { - if (ecdev_open(nic->ecdev)) { + err = ecdev_open(nic->ecdev); + if (err) { ecdev_withdraw(nic->ecdev); goto err_out_free; } diff -r d94281cb835a -r 87e502828b3f devices/e100-2.6.32-ethercat.c --- a/devices/e100-2.6.32-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e100-2.6.32-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -3003,7 +3003,8 @@ pdev->irq, netdev->dev_addr); if (nic->ecdev) { - if (ecdev_open(nic->ecdev)) { + err = ecdev_open(nic->ecdev); + if (err) { ecdev_withdraw(nic->ecdev); goto err_out_free; } diff -r d94281cb835a -r 87e502828b3f devices/e100-2.6.33-ethercat.c --- a/devices/e100-2.6.33-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e100-2.6.33-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -3011,7 +3011,8 @@ pdev->irq, netdev->dev_addr); if (nic->ecdev) { - if (ecdev_open(nic->ecdev)) { + err = ecdev_open(nic->ecdev); + if (err) { ecdev_withdraw(nic->ecdev); goto err_out_free; } diff -r d94281cb835a -r 87e502828b3f devices/e100-2.6.35-ethercat.c --- a/devices/e100-2.6.35-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e100-2.6.35-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -3037,7 +3037,8 @@ pdev->irq, netdev->dev_addr); if (nic->ecdev) { - if (ecdev_open(nic->ecdev)) { + err = ecdev_open(nic->ecdev); + if (err) { ecdev_withdraw(nic->ecdev); goto err_out_free; } diff -r d94281cb835a -r 87e502828b3f devices/e100-2.6.37-ethercat.c --- a/devices/e100-2.6.37-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e100-2.6.37-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -3037,7 +3037,8 @@ pdev->irq, netdev->dev_addr); if (nic->ecdev) { - if (ecdev_open(nic->ecdev)) { + err = ecdev_open(nic->ecdev); + if (err) { ecdev_withdraw(nic->ecdev); goto err_out_free; } diff -r d94281cb835a -r 87e502828b3f devices/e100-3.0-ethercat.c --- a/devices/e100-3.0-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e100-3.0-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -3029,7 +3029,8 @@ pdev->irq, netdev->dev_addr); if (nic->ecdev) { - if (ecdev_open(nic->ecdev)) { + err = ecdev_open(nic->ecdev); + if (err) { ecdev_withdraw(nic->ecdev); goto err_out_free; } diff -r d94281cb835a -r 87e502828b3f devices/e100-3.4-ethercat.c --- a/devices/e100-3.4-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e100-3.4-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -3096,7 +3096,8 @@ pdev->irq, netdev->dev_addr); if (nic->ecdev) { - if (ecdev_open(nic->ecdev)) { + err = ecdev_open(nic->ecdev); + if (err) { ecdev_withdraw(nic->ecdev); goto err_out_free; } diff -r d94281cb835a -r 87e502828b3f devices/e100-3.6-ethercat.c --- a/devices/e100-3.6-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e100-3.6-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -3120,7 +3120,8 @@ pdev->irq, netdev->dev_addr); if (nic->ecdev) { - if (ecdev_open(nic->ecdev)) { + err = ecdev_open(nic->ecdev); + if (err) { ecdev_withdraw(nic->ecdev); goto err_out_free; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-2.6.13-ethercat.c --- a/devices/e1000/e1000_main-2.6.13-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-2.6.13-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -717,7 +717,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-2.6.18-ethercat.c --- a/devices/e1000/e1000_main-2.6.18-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-2.6.18-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -983,7 +983,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-2.6.20-ethercat.c --- a/devices/e1000/e1000_main-2.6.20-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-2.6.20-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1190,7 +1190,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-2.6.22-ethercat.c --- a/devices/e1000/e1000_main-2.6.22-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-2.6.22-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1173,7 +1173,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-2.6.24-ethercat.c --- a/devices/e1000/e1000_main-2.6.24-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-2.6.24-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1177,7 +1177,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-2.6.26-ethercat.c --- a/devices/e1000/e1000_main-2.6.26-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-2.6.26-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1243,7 +1243,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-2.6.27-ethercat.c --- a/devices/e1000/e1000_main-2.6.27-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-2.6.27-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1248,7 +1248,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-2.6.28-ethercat.c --- a/devices/e1000/e1000_main-2.6.28-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-2.6.28-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1247,7 +1247,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-2.6.29-ethercat.c --- a/devices/e1000/e1000_main-2.6.29-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-2.6.29-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1248,7 +1248,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-2.6.31-ethercat.c --- a/devices/e1000/e1000_main-2.6.31-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-2.6.31-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1269,7 +1269,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-2.6.32-ethercat.c --- a/devices/e1000/e1000_main-2.6.32-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-2.6.32-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1082,7 +1082,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-2.6.33-ethercat.c --- a/devices/e1000/e1000_main-2.6.33-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-2.6.33-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1082,7 +1082,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-2.6.35-ethercat.c --- a/devices/e1000/e1000_main-2.6.35-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-2.6.35-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1076,7 +1076,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-2.6.37-ethercat.c --- a/devices/e1000/e1000_main-2.6.37-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-2.6.37-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1177,7 +1177,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-3.0-ethercat.c --- a/devices/e1000/e1000_main-3.0-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-3.0-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1209,7 +1209,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-3.4-ethercat.c --- a/devices/e1000/e1000_main-3.4-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-3.4-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1256,7 +1256,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000/e1000_main-3.6-ethercat.c --- a/devices/e1000/e1000_main-3.6-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000/e1000_main-3.6-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1256,7 +1256,8 @@ // offer device to EtherCAT master module adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000e/netdev-2.6.32-ethercat.c --- a/devices/e1000e/netdev-2.6.32-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000e/netdev-2.6.32-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -5360,7 +5360,8 @@ adapter->ecdev = ecdev_offer(netdev,ec_poll,THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000e/netdev-2.6.33-ethercat.c --- a/devices/e1000e/netdev-2.6.33-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000e/netdev-2.6.33-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -5364,7 +5364,8 @@ adapter->ecdev = ecdev_offer(netdev,ec_poll,THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000e/netdev-2.6.34-ethercat.c --- a/devices/e1000e/netdev-2.6.34-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000e/netdev-2.6.34-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -5357,7 +5357,8 @@ adapter->ecdev = ecdev_offer(netdev,ec_poll,THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000e/netdev-2.6.35-ethercat.c --- a/devices/e1000e/netdev-2.6.35-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000e/netdev-2.6.35-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -5863,7 +5863,8 @@ adapter->ecdev = ecdev_offer(netdev,ec_poll,THIS_MODULE); if (adapter->ecdev) { - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } diff -r d94281cb835a -r 87e502828b3f devices/e1000e/netdev-2.6.37-ethercat.c --- a/devices/e1000e/netdev-2.6.37-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000e/netdev-2.6.37-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -6069,11 +6069,12 @@ adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - adapter->ec_watchdog_jiffies = jiffies; - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } + adapter->ec_watchdog_jiffies = jiffies; } else { strcpy(netdev->name, "eth%d"); err = register_netdev(netdev); diff -r d94281cb835a -r 87e502828b3f devices/e1000e/netdev-3.2-ethercat.c --- a/devices/e1000e/netdev-3.2-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000e/netdev-3.2-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -6360,11 +6360,12 @@ adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - adapter->ec_watchdog_jiffies = jiffies; - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } + adapter->ec_watchdog_jiffies = jiffies; } else { strncpy(netdev->name, "eth%d", sizeof(netdev->name) - 1); err = register_netdev(netdev); diff -r d94281cb835a -r 87e502828b3f devices/e1000e/netdev-3.4-ethercat.c --- a/devices/e1000e/netdev-3.4-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000e/netdev-3.4-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -6518,11 +6518,12 @@ adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - adapter->ec_watchdog_jiffies = jiffies; - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } + adapter->ec_watchdog_jiffies = jiffies; } else { strlcpy(netdev->name, "eth%d", sizeof(netdev->name)); err = register_netdev(netdev); diff -r d94281cb835a -r 87e502828b3f devices/e1000e/netdev-3.6-ethercat.c --- a/devices/e1000e/netdev-3.6-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/e1000e/netdev-3.6-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -6540,11 +6540,12 @@ adapter->ecdev = ecdev_offer(netdev, ec_poll, THIS_MODULE); if (adapter->ecdev) { - adapter->ec_watchdog_jiffies = jiffies; - if (ecdev_open(adapter->ecdev)) { + err = ecdev_open(adapter->ecdev); + if (err) { ecdev_withdraw(adapter->ecdev); goto err_register; } + adapter->ec_watchdog_jiffies = jiffies; } else { strlcpy(netdev->name, "eth%d", sizeof(netdev->name)); err = register_netdev(netdev); diff -r d94281cb835a -r 87e502828b3f devices/r8169-2.6.24-ethercat.c --- a/devices/r8169-2.6.24-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/r8169-2.6.24-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -1846,9 +1846,12 @@ rtl8169_init_phy(dev, tp); - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out_msi_5; + if (tp->ecdev) { + rc = ecdev_open(tp->ecdev); + if (rc) { + ecdev_withdraw(tp->ecdev); + goto err_out_msi_5; + } } out: diff -r d94281cb835a -r 87e502828b3f devices/r8169-2.6.27-ethercat.c --- a/devices/r8169-2.6.27-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/r8169-2.6.27-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -2013,9 +2013,12 @@ rtl8169_init_phy(dev, tp); - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out_msi_5; + if (tp->ecdev) { + rc = ecdev_open(tp->ecdev); + if (rc) { + ecdev_withdraw(tp->ecdev); + goto err_out_msi_5; + } } out: diff -r d94281cb835a -r 87e502828b3f devices/r8169-2.6.28-ethercat.c --- a/devices/r8169-2.6.28-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/r8169-2.6.28-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -2176,11 +2176,14 @@ rtl8169_init_phy(dev, tp); device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL); - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out_msi_5; - } - + + if (tp->ecdev) { + rc = ecdev_open(tp->ecdev); + if (rc) { + ecdev_withdraw(tp->ecdev); + goto err_out_msi_5; + } + } out: return rc; diff -r d94281cb835a -r 87e502828b3f devices/r8169-2.6.29-ethercat.c --- a/devices/r8169-2.6.29-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/r8169-2.6.29-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -2213,9 +2213,12 @@ rtl8169_init_phy(dev, tp); device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL); - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out_msi_5; + if (tp->ecdev) { + rc = ecdev_open(tp->ecdev); + if (rc) { + ecdev_withdraw(tp->ecdev); + goto err_out_msi_5; + } } out: diff -r d94281cb835a -r 87e502828b3f devices/r8169-2.6.31-ethercat.c --- a/devices/r8169-2.6.31-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/r8169-2.6.31-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -2217,11 +2217,14 @@ rtl8169_init_phy(dev, tp); device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL); - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out_msi_5; - } - + + if (tp->ecdev) { + rc = ecdev_open(tp->ecdev); + if (rc) { + ecdev_withdraw(tp->ecdev); + goto err_out_msi_5; + } + } out: return rc; diff -r d94281cb835a -r 87e502828b3f devices/r8169-2.6.32-ethercat.c --- a/devices/r8169-2.6.32-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/r8169-2.6.32-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -3228,9 +3228,13 @@ RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) | RxVlan); device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL); - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out_msi_5; + + if (tp->ecdev) { + rc = ecdev_open(tp->ecdev); + if (rc) { + ecdev_withdraw(tp->ecdev); + goto err_out_msi_5; + } } out: diff -r d94281cb835a -r 87e502828b3f devices/r8169-2.6.33-ethercat.c --- a/devices/r8169-2.6.33-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/r8169-2.6.33-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -3234,9 +3234,12 @@ device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL); - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out_msi_5; + if (tp->ecdev) { + rc = ecdev_open(tp->ecdev); + if (rc) { + ecdev_withdraw(tp->ecdev); + goto err_out_msi_5; + } } out: diff -r d94281cb835a -r 87e502828b3f devices/r8169-2.6.35-ethercat.c --- a/devices/r8169-2.6.35-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/r8169-2.6.35-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -3246,9 +3246,12 @@ } pm_runtime_idle(&pdev->dev); - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out_msi_4; + if (tp->ecdev) { + rc = ecdev_open(tp->ecdev); + if (rc) { + ecdev_withdraw(tp->ecdev); + goto err_out_msi_4; + } } out: diff -r d94281cb835a -r 87e502828b3f devices/r8169-2.6.36-ethercat.c --- a/devices/r8169-2.6.36-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/r8169-2.6.36-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -3239,15 +3239,18 @@ RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) | RxVlan); device_set_wakeup_enable(&pdev->dev, tp->features & RTL_FEATURE_WOL); - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out_msi_4; - } - - if(!tp->ecdev) { - if (pci_dev_run_wake(pdev)) - pm_runtime_put_noidle(&pdev->dev); - } + + if (pci_dev_run_wake(pdev)) + pm_runtime_put_noidle(&pdev->dev); + + if (tp->ecdev) { + rc = ecdev_open(tp->ecdev); + if (rc) { + ecdev_withdraw(tp->ecdev); + goto err_out_msi_4; + } + } + out: return rc; diff -r d94281cb835a -r 87e502828b3f devices/r8169-2.6.37-ethercat.c --- a/devices/r8169-2.6.37-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/r8169-2.6.37-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -3256,15 +3256,17 @@ if (pci_dev_run_wake(pdev)) pm_runtime_put_noidle(&pdev->dev); - if (!tp->ecdev) { + if (tp->ecdev) { + rc = ecdev_open(tp->ecdev); + if (rc) { + ecdev_withdraw(tp->ecdev); + goto err_out_msi_4; + } + } + else { netif_carrier_off(dev); } - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out_msi_4; - } - out: return rc; diff -r d94281cb835a -r 87e502828b3f devices/r8169-3.2-ethercat.c --- a/devices/r8169-3.2-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/r8169-3.2-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -4196,11 +4196,15 @@ if (pci_dev_run_wake(pdev)) pm_runtime_put_noidle(&pdev->dev); - netif_carrier_off(dev); - - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out_msi_4; + if (tp->ecdev) { + rc = ecdev_open(tp->ecdev); + if (rc) { + ecdev_withdraw(tp->ecdev); + goto err_out_msi_4; + } + } + else { + netif_carrier_off(dev); } out: diff -r d94281cb835a -r 87e502828b3f devices/r8169-3.4-ethercat.c --- a/devices/r8169-3.4-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/r8169-3.4-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -6404,11 +6404,15 @@ if (pci_dev_run_wake(pdev)) pm_runtime_put_noidle(&pdev->dev); - netif_carrier_off(dev); - - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out_msi_4; + if (tp->ecdev) { + rc = ecdev_open(tp->ecdev); + if (rc) { + ecdev_withdraw(tp->ecdev); + goto err_out_msi_4; + } + } + else { + netif_carrier_off(dev); } out: diff -r d94281cb835a -r 87e502828b3f devices/r8169-3.6-ethercat.c --- a/devices/r8169-3.6-ethercat.c Mon Oct 27 14:55:50 2014 +0100 +++ b/devices/r8169-3.6-ethercat.c Mon Oct 27 16:33:23 2014 +0100 @@ -7104,11 +7104,15 @@ if (pci_dev_run_wake(pdev)) pm_runtime_put_noidle(&pdev->dev); - netif_carrier_off(dev); - - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out_msi_4; + if (tp->ecdev) { + rc = ecdev_open(tp->ecdev); + if (rc) { + ecdev_withdraw(tp->ecdev); + goto err_out_msi_4; + } + } + else { + netif_carrier_off(dev); } out: