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,10 +1145,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1149,10 +1149,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1150,10 +1150,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1149,10 +1149,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1149,10 +1149,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1146,10 +1146,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1139,10 +1139,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1139,10 +1139,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1139,10 +1139,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1145,10 +1145,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1145,10 +1145,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1145,10 +1145,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1134,10 +1134,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1134,10 +1134,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1134,10 +1134,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1135,10 +1135,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1136,10 +1136,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1138,10 +1138,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1140,10 +1140,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1141,10 +1141,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1142,10 +1142,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1182,10 +1182,13 @@ 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)) {
if (tp->ecdev) {
i = ecdev_open(tp->ecdev);
if (i) {
ecdev_withdraw(tp->ecdev);
goto err_out;
}
}
return 0;

View File

@ -1156,10 +1156,13 @@ 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)) {
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,10 +1846,13 @@ 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)) {
if (tp->ecdev) {
rc = ecdev_open(tp->ecdev);
if (rc) {
ecdev_withdraw(tp->ecdev);
goto err_out_msi_5;
}
}
out:
return rc;

View File

@ -2013,10 +2013,13 @@ 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)) {
if (tp->ecdev) {
rc = ecdev_open(tp->ecdev);
if (rc) {
ecdev_withdraw(tp->ecdev);
goto err_out_msi_5;
}
}
out:
return rc;

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)) {
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,10 +2213,13 @@ 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)) {
if (tp->ecdev) {
rc = ecdev_open(tp->ecdev);
if (rc) {
ecdev_withdraw(tp->ecdev);
goto err_out_msi_5;
}
}
out:
return rc;

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)) {
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,10 +3228,14 @@ 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)) {
if (tp->ecdev) {
rc = ecdev_open(tp->ecdev);
if (rc) {
ecdev_withdraw(tp->ecdev);
goto err_out_msi_5;
}
}
out:
return rc;

View File

@ -3234,10 +3234,13 @@ 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)) {
if (tp->ecdev) {
rc = ecdev_open(tp->ecdev);
if (rc) {
ecdev_withdraw(tp->ecdev);
goto err_out_msi_5;
}
}
out:
return rc;

View File

@ -3246,10 +3246,13 @@ 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)) {
if (tp->ecdev) {
rc = ecdev_open(tp->ecdev);
if (rc) {
ecdev_withdraw(tp->ecdev);
goto err_out_msi_4;
}
}
out:
return rc;

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)) {
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,14 +3256,16 @@ 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 && ecdev_open(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);
}
out:
return rc;

View File

@ -4196,12 +4196,16 @@ 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)) {
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:
return rc;

View File

@ -6404,12 +6404,16 @@ 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)) {
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:
return rc;

View File

@ -7104,12 +7104,16 @@ 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)) {
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:
return rc;