Use return value of ecdev_open(); thanks to Patrick Bruenn.

This commit is contained in:
Florian Pose 2014-10-27 16:33:23 +01:00
parent 6bb5990dff
commit 7cb12f0cb8
75 changed files with 316 additions and 166 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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:

View File

@ -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:

View File

@ -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;

View File

@ -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:

View File

@ -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;

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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;

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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: