From 7cb12f0cb8eb12a990de257665d59cffa08bf8a3 Mon Sep 17 00:00:00 2001 From: Florian Pose Date: Mon, 27 Oct 2014 16:33:23 +0100 Subject: [PATCH] Use return value of ecdev_open(); thanks to Patrick Bruenn. --- devices/8139too-2.6.13-ethercat.c | 9 ++++++--- devices/8139too-2.6.17-ethercat.c | 9 ++++++--- devices/8139too-2.6.18-ethercat.c | 9 ++++++--- devices/8139too-2.6.19-ethercat.c | 9 ++++++--- devices/8139too-2.6.22-ethercat.c | 9 ++++++--- devices/8139too-2.6.23-ethercat.c | 9 ++++++--- devices/8139too-2.6.24-ethercat.c | 9 ++++++--- devices/8139too-2.6.25-ethercat.c | 9 ++++++--- devices/8139too-2.6.26-ethercat.c | 9 ++++++--- devices/8139too-2.6.27-ethercat.c | 9 ++++++--- devices/8139too-2.6.28-ethercat.c | 9 ++++++--- devices/8139too-2.6.29-ethercat.c | 9 ++++++--- devices/8139too-2.6.31-ethercat.c | 9 ++++++--- devices/8139too-2.6.32-ethercat.c | 9 ++++++--- devices/8139too-2.6.33-ethercat.c | 9 ++++++--- devices/8139too-2.6.34-ethercat.c | 9 ++++++--- devices/8139too-2.6.35-ethercat.c | 9 ++++++--- devices/8139too-2.6.36-ethercat.c | 9 ++++++--- devices/8139too-2.6.37-ethercat.c | 9 ++++++--- devices/8139too-3.0-ethercat.c | 9 ++++++--- devices/8139too-3.2-ethercat.c | 9 ++++++--- devices/8139too-3.4-ethercat.c | 9 ++++++--- devices/8139too-3.6-ethercat.c | 9 ++++++--- devices/e100-2.6.20-ethercat.c | 3 ++- devices/e100-2.6.24-ethercat.c | 3 ++- devices/e100-2.6.26-ethercat.c | 3 ++- devices/e100-2.6.27-ethercat.c | 3 ++- devices/e100-2.6.28-ethercat.c | 3 ++- devices/e100-2.6.29-ethercat.c | 3 ++- devices/e100-2.6.31-ethercat.c | 3 ++- devices/e100-2.6.32-ethercat.c | 3 ++- devices/e100-2.6.33-ethercat.c | 3 ++- devices/e100-2.6.35-ethercat.c | 3 ++- devices/e100-2.6.37-ethercat.c | 3 ++- devices/e100-3.0-ethercat.c | 3 ++- devices/e100-3.4-ethercat.c | 3 ++- devices/e100-3.6-ethercat.c | 3 ++- devices/e1000/e1000_main-2.6.13-ethercat.c | 3 ++- devices/e1000/e1000_main-2.6.18-ethercat.c | 3 ++- devices/e1000/e1000_main-2.6.20-ethercat.c | 3 ++- devices/e1000/e1000_main-2.6.22-ethercat.c | 3 ++- devices/e1000/e1000_main-2.6.24-ethercat.c | 3 ++- devices/e1000/e1000_main-2.6.26-ethercat.c | 3 ++- devices/e1000/e1000_main-2.6.27-ethercat.c | 3 ++- devices/e1000/e1000_main-2.6.28-ethercat.c | 3 ++- devices/e1000/e1000_main-2.6.29-ethercat.c | 3 ++- devices/e1000/e1000_main-2.6.31-ethercat.c | 3 ++- devices/e1000/e1000_main-2.6.32-ethercat.c | 3 ++- devices/e1000/e1000_main-2.6.33-ethercat.c | 3 ++- devices/e1000/e1000_main-2.6.35-ethercat.c | 3 ++- devices/e1000/e1000_main-2.6.37-ethercat.c | 3 ++- devices/e1000/e1000_main-3.0-ethercat.c | 3 ++- devices/e1000/e1000_main-3.4-ethercat.c | 3 ++- devices/e1000/e1000_main-3.6-ethercat.c | 3 ++- devices/e1000e/netdev-2.6.32-ethercat.c | 3 ++- devices/e1000e/netdev-2.6.33-ethercat.c | 3 ++- devices/e1000e/netdev-2.6.34-ethercat.c | 3 ++- devices/e1000e/netdev-2.6.35-ethercat.c | 3 ++- devices/e1000e/netdev-2.6.37-ethercat.c | 5 +++-- devices/e1000e/netdev-3.2-ethercat.c | 5 +++-- devices/e1000e/netdev-3.4-ethercat.c | 5 +++-- devices/e1000e/netdev-3.6-ethercat.c | 5 +++-- devices/r8169-2.6.24-ethercat.c | 9 ++++++--- devices/r8169-2.6.27-ethercat.c | 9 ++++++--- devices/r8169-2.6.28-ethercat.c | 11 +++++++---- devices/r8169-2.6.29-ethercat.c | 9 ++++++--- devices/r8169-2.6.31-ethercat.c | 11 +++++++---- devices/r8169-2.6.32-ethercat.c | 10 +++++++--- devices/r8169-2.6.33-ethercat.c | 9 ++++++--- devices/r8169-2.6.35-ethercat.c | 9 ++++++--- devices/r8169-2.6.36-ethercat.c | 17 ++++++++++------- devices/r8169-2.6.37-ethercat.c | 14 ++++++++------ devices/r8169-3.2-ethercat.c | 14 +++++++++----- devices/r8169-3.4-ethercat.c | 14 +++++++++----- devices/r8169-3.6-ethercat.c | 14 +++++++++----- 75 files changed, 316 insertions(+), 166 deletions(-) diff --git a/devices/8139too-2.6.13-ethercat.c b/devices/8139too-2.6.13-ethercat.c index 0c7b3701..90779896 100644 --- a/devices/8139too-2.6.13-ethercat.c +++ b/devices/8139too-2.6.13-ethercat.c @@ -1145,9 +1145,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.17-ethercat.c b/devices/8139too-2.6.17-ethercat.c index 8d0656ab..7af43cb9 100644 --- a/devices/8139too-2.6.17-ethercat.c +++ b/devices/8139too-2.6.17-ethercat.c @@ -1149,9 +1149,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.18-ethercat.c b/devices/8139too-2.6.18-ethercat.c index 7dd62d2f..e85c028a 100644 --- a/devices/8139too-2.6.18-ethercat.c +++ b/devices/8139too-2.6.18-ethercat.c @@ -1150,9 +1150,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.19-ethercat.c b/devices/8139too-2.6.19-ethercat.c index 3acc53b4..d015240c 100644 --- a/devices/8139too-2.6.19-ethercat.c +++ b/devices/8139too-2.6.19-ethercat.c @@ -1149,9 +1149,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.22-ethercat.c b/devices/8139too-2.6.22-ethercat.c index 8faac7a7..cbd73205 100644 --- a/devices/8139too-2.6.22-ethercat.c +++ b/devices/8139too-2.6.22-ethercat.c @@ -1149,9 +1149,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.23-ethercat.c b/devices/8139too-2.6.23-ethercat.c index 7059fb4b..88136b02 100644 --- a/devices/8139too-2.6.23-ethercat.c +++ b/devices/8139too-2.6.23-ethercat.c @@ -1146,9 +1146,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.24-ethercat.c b/devices/8139too-2.6.24-ethercat.c index fe87cdb8..8a216208 100644 --- a/devices/8139too-2.6.24-ethercat.c +++ b/devices/8139too-2.6.24-ethercat.c @@ -1139,9 +1139,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.25-ethercat.c b/devices/8139too-2.6.25-ethercat.c index a76754ce..cbf3552b 100644 --- a/devices/8139too-2.6.25-ethercat.c +++ b/devices/8139too-2.6.25-ethercat.c @@ -1139,9 +1139,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.26-ethercat.c b/devices/8139too-2.6.26-ethercat.c index 13468d7b..67165b2f 100644 --- a/devices/8139too-2.6.26-ethercat.c +++ b/devices/8139too-2.6.26-ethercat.c @@ -1139,9 +1139,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.27-ethercat.c b/devices/8139too-2.6.27-ethercat.c index d58159f6..28e9ac25 100644 --- a/devices/8139too-2.6.27-ethercat.c +++ b/devices/8139too-2.6.27-ethercat.c @@ -1145,9 +1145,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.28-ethercat.c b/devices/8139too-2.6.28-ethercat.c index 594fd39a..336a2f25 100644 --- a/devices/8139too-2.6.28-ethercat.c +++ b/devices/8139too-2.6.28-ethercat.c @@ -1145,9 +1145,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.29-ethercat.c b/devices/8139too-2.6.29-ethercat.c index 399ead5c..bf7a3000 100644 --- a/devices/8139too-2.6.29-ethercat.c +++ b/devices/8139too-2.6.29-ethercat.c @@ -1145,9 +1145,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.31-ethercat.c b/devices/8139too-2.6.31-ethercat.c index 16c8ac42..fc9ad88f 100644 --- a/devices/8139too-2.6.31-ethercat.c +++ b/devices/8139too-2.6.31-ethercat.c @@ -1134,9 +1134,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.32-ethercat.c b/devices/8139too-2.6.32-ethercat.c index 6eda9475..3346c9ac 100644 --- a/devices/8139too-2.6.32-ethercat.c +++ b/devices/8139too-2.6.32-ethercat.c @@ -1134,9 +1134,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.33-ethercat.c b/devices/8139too-2.6.33-ethercat.c index 6e0a574c..a8bd8412 100644 --- a/devices/8139too-2.6.33-ethercat.c +++ b/devices/8139too-2.6.33-ethercat.c @@ -1134,9 +1134,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.34-ethercat.c b/devices/8139too-2.6.34-ethercat.c index 35948fe3..408a52b7 100644 --- a/devices/8139too-2.6.34-ethercat.c +++ b/devices/8139too-2.6.34-ethercat.c @@ -1135,9 +1135,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.35-ethercat.c b/devices/8139too-2.6.35-ethercat.c index 4c1f6f51..1c2c2d8a 100644 --- a/devices/8139too-2.6.35-ethercat.c +++ b/devices/8139too-2.6.35-ethercat.c @@ -1136,9 +1136,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.36-ethercat.c b/devices/8139too-2.6.36-ethercat.c index 61a58714..50c6ded4 100644 --- a/devices/8139too-2.6.36-ethercat.c +++ b/devices/8139too-2.6.36-ethercat.c @@ -1138,9 +1138,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-2.6.37-ethercat.c b/devices/8139too-2.6.37-ethercat.c index 368dd730..38accc01 100644 --- a/devices/8139too-2.6.37-ethercat.c +++ b/devices/8139too-2.6.37-ethercat.c @@ -1140,9 +1140,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-3.0-ethercat.c b/devices/8139too-3.0-ethercat.c index 44cf44e6..0e107331 100644 --- a/devices/8139too-3.0-ethercat.c +++ b/devices/8139too-3.0-ethercat.c @@ -1141,9 +1141,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-3.2-ethercat.c b/devices/8139too-3.2-ethercat.c index db70b398..95b6eddd 100644 --- a/devices/8139too-3.2-ethercat.c +++ b/devices/8139too-3.2-ethercat.c @@ -1142,9 +1142,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-3.4-ethercat.c b/devices/8139too-3.4-ethercat.c index f0f20229..274517a2 100644 --- a/devices/8139too-3.4-ethercat.c +++ b/devices/8139too-3.4-ethercat.c @@ -1182,9 +1182,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/8139too-3.6-ethercat.c b/devices/8139too-3.6-ethercat.c index 382ba3f2..b09052f6 100644 --- a/devices/8139too-3.6-ethercat.c +++ b/devices/8139too-3.6-ethercat.c @@ -1156,9 +1156,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, 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 --git a/devices/e100-2.6.20-ethercat.c b/devices/e100-2.6.20-ethercat.c index a1fbd0f5..634f0648 100644 --- a/devices/e100-2.6.20-ethercat.c +++ b/devices/e100-2.6.20-ethercat.c @@ -2804,7 +2804,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, // 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 --git a/devices/e100-2.6.24-ethercat.c b/devices/e100-2.6.24-ethercat.c index d5d538ad..6b48493c 100644 --- a/devices/e100-2.6.24-ethercat.c +++ b/devices/e100-2.6.24-ethercat.c @@ -2817,7 +2817,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, // 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 --git a/devices/e100-2.6.26-ethercat.c b/devices/e100-2.6.26-ethercat.c index 9b799d06..158da5aa 100644 --- a/devices/e100-2.6.26-ethercat.c +++ b/devices/e100-2.6.26-ethercat.c @@ -2888,7 +2888,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, // 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 --git a/devices/e100-2.6.27-ethercat.c b/devices/e100-2.6.27-ethercat.c index 90ec27f0..206ac50f 100644 --- a/devices/e100-2.6.27-ethercat.c +++ b/devices/e100-2.6.27-ethercat.c @@ -2896,7 +2896,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, // 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 --git a/devices/e100-2.6.28-ethercat.c b/devices/e100-2.6.28-ethercat.c index f9339dbf..fb74e5fc 100644 --- a/devices/e100-2.6.28-ethercat.c +++ b/devices/e100-2.6.28-ethercat.c @@ -2886,7 +2886,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, // 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 --git a/devices/e100-2.6.29-ethercat.c b/devices/e100-2.6.29-ethercat.c index 45e172e1..bbbd9a45 100644 --- a/devices/e100-2.6.29-ethercat.c +++ b/devices/e100-2.6.29-ethercat.c @@ -2790,7 +2790,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, // 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 --git a/devices/e100-2.6.31-ethercat.c b/devices/e100-2.6.31-ethercat.c index 1bf067e7..2fbef57c 100644 --- a/devices/e100-2.6.31-ethercat.c +++ b/devices/e100-2.6.31-ethercat.c @@ -2971,7 +2971,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, // 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 --git a/devices/e100-2.6.32-ethercat.c b/devices/e100-2.6.32-ethercat.c index 1ee79103..cc131f1a 100644 --- a/devices/e100-2.6.32-ethercat.c +++ b/devices/e100-2.6.32-ethercat.c @@ -3003,7 +3003,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, 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 --git a/devices/e100-2.6.33-ethercat.c b/devices/e100-2.6.33-ethercat.c index 0c0b4655..35c1a287 100644 --- a/devices/e100-2.6.33-ethercat.c +++ b/devices/e100-2.6.33-ethercat.c @@ -3011,7 +3011,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, 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 --git a/devices/e100-2.6.35-ethercat.c b/devices/e100-2.6.35-ethercat.c index 1ef05b34..1d935b70 100644 --- a/devices/e100-2.6.35-ethercat.c +++ b/devices/e100-2.6.35-ethercat.c @@ -3037,7 +3037,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, 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 --git a/devices/e100-2.6.37-ethercat.c b/devices/e100-2.6.37-ethercat.c index 430d5b09..c536f007 100644 --- a/devices/e100-2.6.37-ethercat.c +++ b/devices/e100-2.6.37-ethercat.c @@ -3037,7 +3037,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, 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 --git a/devices/e100-3.0-ethercat.c b/devices/e100-3.0-ethercat.c index d98e755d..30e7d3c5 100644 --- a/devices/e100-3.0-ethercat.c +++ b/devices/e100-3.0-ethercat.c @@ -3029,7 +3029,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, 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 --git a/devices/e100-3.4-ethercat.c b/devices/e100-3.4-ethercat.c index a667ec22..bbf5da3c 100644 --- a/devices/e100-3.4-ethercat.c +++ b/devices/e100-3.4-ethercat.c @@ -3096,7 +3096,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, 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 --git a/devices/e100-3.6-ethercat.c b/devices/e100-3.6-ethercat.c index 7bbabc92..26d290d6 100644 --- a/devices/e100-3.6-ethercat.c +++ b/devices/e100-3.6-ethercat.c @@ -3120,7 +3120,8 @@ static int __devinit e100_probe(struct pci_dev *pdev, 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 --git a/devices/e1000/e1000_main-2.6.13-ethercat.c b/devices/e1000/e1000_main-2.6.13-ethercat.c index ad8afd47..148c68c4 100644 --- a/devices/e1000/e1000_main-2.6.13-ethercat.c +++ b/devices/e1000/e1000_main-2.6.13-ethercat.c @@ -717,7 +717,8 @@ e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-2.6.18-ethercat.c b/devices/e1000/e1000_main-2.6.18-ethercat.c index 6cd7767b..ce471168 100644 --- a/devices/e1000/e1000_main-2.6.18-ethercat.c +++ b/devices/e1000/e1000_main-2.6.18-ethercat.c @@ -983,7 +983,8 @@ e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-2.6.20-ethercat.c b/devices/e1000/e1000_main-2.6.20-ethercat.c index 74370e0b..259683bc 100644 --- a/devices/e1000/e1000_main-2.6.20-ethercat.c +++ b/devices/e1000/e1000_main-2.6.20-ethercat.c @@ -1190,7 +1190,8 @@ e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-2.6.22-ethercat.c b/devices/e1000/e1000_main-2.6.22-ethercat.c index 22efa6a6..cffbc6f5 100644 --- a/devices/e1000/e1000_main-2.6.22-ethercat.c +++ b/devices/e1000/e1000_main-2.6.22-ethercat.c @@ -1173,7 +1173,8 @@ e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-2.6.24-ethercat.c b/devices/e1000/e1000_main-2.6.24-ethercat.c index 7b7734d3..cfc1c755 100644 --- a/devices/e1000/e1000_main-2.6.24-ethercat.c +++ b/devices/e1000/e1000_main-2.6.24-ethercat.c @@ -1177,7 +1177,8 @@ e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-2.6.26-ethercat.c b/devices/e1000/e1000_main-2.6.26-ethercat.c index 466234c9..b73fcc02 100644 --- a/devices/e1000/e1000_main-2.6.26-ethercat.c +++ b/devices/e1000/e1000_main-2.6.26-ethercat.c @@ -1243,7 +1243,8 @@ e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-2.6.27-ethercat.c b/devices/e1000/e1000_main-2.6.27-ethercat.c index 98e9f239..1ed703ba 100644 --- a/devices/e1000/e1000_main-2.6.27-ethercat.c +++ b/devices/e1000/e1000_main-2.6.27-ethercat.c @@ -1248,7 +1248,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-2.6.28-ethercat.c b/devices/e1000/e1000_main-2.6.28-ethercat.c index e29b7fe7..a2012e12 100644 --- a/devices/e1000/e1000_main-2.6.28-ethercat.c +++ b/devices/e1000/e1000_main-2.6.28-ethercat.c @@ -1247,7 +1247,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-2.6.29-ethercat.c b/devices/e1000/e1000_main-2.6.29-ethercat.c index b7b390fb..d899d4ff 100644 --- a/devices/e1000/e1000_main-2.6.29-ethercat.c +++ b/devices/e1000/e1000_main-2.6.29-ethercat.c @@ -1248,7 +1248,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-2.6.31-ethercat.c b/devices/e1000/e1000_main-2.6.31-ethercat.c index d0d47113..21973625 100644 --- a/devices/e1000/e1000_main-2.6.31-ethercat.c +++ b/devices/e1000/e1000_main-2.6.31-ethercat.c @@ -1269,7 +1269,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-2.6.32-ethercat.c b/devices/e1000/e1000_main-2.6.32-ethercat.c index 62280003..f804c4f9 100644 --- a/devices/e1000/e1000_main-2.6.32-ethercat.c +++ b/devices/e1000/e1000_main-2.6.32-ethercat.c @@ -1082,7 +1082,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-2.6.33-ethercat.c b/devices/e1000/e1000_main-2.6.33-ethercat.c index 4d50e819..58d7dc17 100644 --- a/devices/e1000/e1000_main-2.6.33-ethercat.c +++ b/devices/e1000/e1000_main-2.6.33-ethercat.c @@ -1082,7 +1082,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-2.6.35-ethercat.c b/devices/e1000/e1000_main-2.6.35-ethercat.c index fbde9c66..79a8ea09 100644 --- a/devices/e1000/e1000_main-2.6.35-ethercat.c +++ b/devices/e1000/e1000_main-2.6.35-ethercat.c @@ -1076,7 +1076,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-2.6.37-ethercat.c b/devices/e1000/e1000_main-2.6.37-ethercat.c index 7a4253f4..8b3e2065 100644 --- a/devices/e1000/e1000_main-2.6.37-ethercat.c +++ b/devices/e1000/e1000_main-2.6.37-ethercat.c @@ -1177,7 +1177,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-3.0-ethercat.c b/devices/e1000/e1000_main-3.0-ethercat.c index 32d9863f..95ea137e 100644 --- a/devices/e1000/e1000_main-3.0-ethercat.c +++ b/devices/e1000/e1000_main-3.0-ethercat.c @@ -1209,7 +1209,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-3.4-ethercat.c b/devices/e1000/e1000_main-3.4-ethercat.c index 49d1d96d..aef666ec 100644 --- a/devices/e1000/e1000_main-3.4-ethercat.c +++ b/devices/e1000/e1000_main-3.4-ethercat.c @@ -1256,7 +1256,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000/e1000_main-3.6-ethercat.c b/devices/e1000/e1000_main-3.6-ethercat.c index 37193c1b..e14a2573 100644 --- a/devices/e1000/e1000_main-3.6-ethercat.c +++ b/devices/e1000/e1000_main-3.6-ethercat.c @@ -1256,7 +1256,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, // 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 --git a/devices/e1000e/netdev-2.6.32-ethercat.c b/devices/e1000e/netdev-2.6.32-ethercat.c index bfd8071e..988958a6 100644 --- a/devices/e1000e/netdev-2.6.32-ethercat.c +++ b/devices/e1000e/netdev-2.6.32-ethercat.c @@ -5360,7 +5360,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, 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 --git a/devices/e1000e/netdev-2.6.33-ethercat.c b/devices/e1000e/netdev-2.6.33-ethercat.c index 78c94677..4decabe1 100644 --- a/devices/e1000e/netdev-2.6.33-ethercat.c +++ b/devices/e1000e/netdev-2.6.33-ethercat.c @@ -5364,7 +5364,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, 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 --git a/devices/e1000e/netdev-2.6.34-ethercat.c b/devices/e1000e/netdev-2.6.34-ethercat.c index 4c8a8767..0d6207ee 100644 --- a/devices/e1000e/netdev-2.6.34-ethercat.c +++ b/devices/e1000e/netdev-2.6.34-ethercat.c @@ -5357,7 +5357,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, 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 --git a/devices/e1000e/netdev-2.6.35-ethercat.c b/devices/e1000e/netdev-2.6.35-ethercat.c index 4118eb26..2e171889 100644 --- a/devices/e1000e/netdev-2.6.35-ethercat.c +++ b/devices/e1000e/netdev-2.6.35-ethercat.c @@ -5863,7 +5863,8 @@ static int __devinit e1000_probe(struct pci_dev *pdev, 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 --git a/devices/e1000e/netdev-2.6.37-ethercat.c b/devices/e1000e/netdev-2.6.37-ethercat.c index d3a96cd3..4145ee44 100644 --- a/devices/e1000e/netdev-2.6.37-ethercat.c +++ b/devices/e1000e/netdev-2.6.37-ethercat.c @@ -6069,11 +6069,12 @@ static int __devinit e1000_probe(struct pci_dev *pdev, 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 --git a/devices/e1000e/netdev-3.2-ethercat.c b/devices/e1000e/netdev-3.2-ethercat.c index 86ea8660..4f8c2e1f 100644 --- a/devices/e1000e/netdev-3.2-ethercat.c +++ b/devices/e1000e/netdev-3.2-ethercat.c @@ -6360,11 +6360,12 @@ static int __devinit e1000_probe(struct pci_dev *pdev, 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 --git a/devices/e1000e/netdev-3.4-ethercat.c b/devices/e1000e/netdev-3.4-ethercat.c index 9e00880c..8bc488cb 100644 --- a/devices/e1000e/netdev-3.4-ethercat.c +++ b/devices/e1000e/netdev-3.4-ethercat.c @@ -6518,11 +6518,12 @@ static int __devinit e1000_probe(struct pci_dev *pdev, 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 --git a/devices/e1000e/netdev-3.6-ethercat.c b/devices/e1000e/netdev-3.6-ethercat.c index ce9e09d1..a4c9f4ec 100644 --- a/devices/e1000e/netdev-3.6-ethercat.c +++ b/devices/e1000e/netdev-3.6-ethercat.c @@ -6540,11 +6540,12 @@ static int __devinit e1000_probe(struct pci_dev *pdev, 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 --git a/devices/r8169-2.6.24-ethercat.c b/devices/r8169-2.6.24-ethercat.c index 790280f9..8f71dd26 100644 --- a/devices/r8169-2.6.24-ethercat.c +++ b/devices/r8169-2.6.24-ethercat.c @@ -1846,9 +1846,12 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 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 --git a/devices/r8169-2.6.27-ethercat.c b/devices/r8169-2.6.27-ethercat.c index 4d867d9d..922d3928 100644 --- a/devices/r8169-2.6.27-ethercat.c +++ b/devices/r8169-2.6.27-ethercat.c @@ -2013,9 +2013,12 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 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 --git a/devices/r8169-2.6.28-ethercat.c b/devices/r8169-2.6.28-ethercat.c index 9a22a56b..fd5cb413 100644 --- a/devices/r8169-2.6.28-ethercat.c +++ b/devices/r8169-2.6.28-ethercat.c @@ -2176,11 +2176,14 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 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 --git a/devices/r8169-2.6.29-ethercat.c b/devices/r8169-2.6.29-ethercat.c index 86187c66..c38a0ca0 100644 --- a/devices/r8169-2.6.29-ethercat.c +++ b/devices/r8169-2.6.29-ethercat.c @@ -2213,9 +2213,12 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 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 --git a/devices/r8169-2.6.31-ethercat.c b/devices/r8169-2.6.31-ethercat.c index b59605bb..8c7e66a7 100644 --- a/devices/r8169-2.6.31-ethercat.c +++ b/devices/r8169-2.6.31-ethercat.c @@ -2217,11 +2217,14 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 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 --git a/devices/r8169-2.6.32-ethercat.c b/devices/r8169-2.6.32-ethercat.c index d1a10896..ee83fe06 100644 --- a/devices/r8169-2.6.32-ethercat.c +++ b/devices/r8169-2.6.32-ethercat.c @@ -3228,9 +3228,13 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 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 --git a/devices/r8169-2.6.33-ethercat.c b/devices/r8169-2.6.33-ethercat.c index 5c3830aa..09c18c45 100644 --- a/devices/r8169-2.6.33-ethercat.c +++ b/devices/r8169-2.6.33-ethercat.c @@ -3234,9 +3234,12 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 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 --git a/devices/r8169-2.6.35-ethercat.c b/devices/r8169-2.6.35-ethercat.c index af9d4f4f..26295a1b 100644 --- a/devices/r8169-2.6.35-ethercat.c +++ b/devices/r8169-2.6.35-ethercat.c @@ -3246,9 +3246,12 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) } 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 --git a/devices/r8169-2.6.36-ethercat.c b/devices/r8169-2.6.36-ethercat.c index b5409511..6cf80677 100644 --- a/devices/r8169-2.6.36-ethercat.c +++ b/devices/r8169-2.6.36-ethercat.c @@ -3239,15 +3239,18 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 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 (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; + } } - if(!tp->ecdev) { - if (pci_dev_run_wake(pdev)) - pm_runtime_put_noidle(&pdev->dev); - } out: return rc; diff --git a/devices/r8169-2.6.37-ethercat.c b/devices/r8169-2.6.37-ethercat.c index b3724360..9afe228c 100644 --- a/devices/r8169-2.6.37-ethercat.c +++ b/devices/r8169-2.6.37-ethercat.c @@ -3256,13 +3256,15 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) if (pci_dev_run_wake(pdev)) pm_runtime_put_noidle(&pdev->dev); - if (!tp->ecdev) { - netif_carrier_off(dev); + if (tp->ecdev) { + rc = ecdev_open(tp->ecdev); + if (rc) { + ecdev_withdraw(tp->ecdev); + goto err_out_msi_4; + } } - - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out_msi_4; + else { + netif_carrier_off(dev); } out: diff --git a/devices/r8169-3.2-ethercat.c b/devices/r8169-3.2-ethercat.c index ea7b038e..2e9640f5 100644 --- a/devices/r8169-3.2-ethercat.c +++ b/devices/r8169-3.2-ethercat.c @@ -4196,11 +4196,15 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 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 --git a/devices/r8169-3.4-ethercat.c b/devices/r8169-3.4-ethercat.c index f10e2b0d..af3cd75c 100644 --- a/devices/r8169-3.4-ethercat.c +++ b/devices/r8169-3.4-ethercat.c @@ -6404,11 +6404,15 @@ rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 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 --git a/devices/r8169-3.6-ethercat.c b/devices/r8169-3.6-ethercat.c index c2a26518..84e2cc5b 100644 --- a/devices/r8169-3.6-ethercat.c +++ b/devices/r8169-3.6-ethercat.c @@ -7104,11 +7104,15 @@ rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) 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: