diff -r af21f0bdc7c9 -r 2b9c78543663 devices/8139too-2.6.19-ethercat.c --- a/devices/8139too-2.6.19-ethercat.c Thu Sep 06 14:21:02 2012 +0200 +++ b/devices/8139too-2.6.19-ethercat.c Mon Nov 03 15:20:05 2014 +0100 @@ -644,7 +644,7 @@ struct mii_if_info mii; unsigned int regs_len; unsigned long fifo_copy_timeout; - + ec_device_t *ecdev; }; @@ -1067,7 +1067,7 @@ tp->mii.reg_num_mask = 0x1f; /* dev is fully set up and ready to use now */ - + // offer device to EtherCAT master module tp->ecdev = ecdev_offer(dev, ec_poll, THIS_MODULE); @@ -1149,9 +1149,12 @@ if (rtl_chip_info[tp->chipset].flags & HasHltClk) RTL_W8 (HltClk, 'H'); /* 'R' would leave the clock running. */ - if (tp->ecdev && ecdev_open(tp->ecdev)) { - ecdev_withdraw(tp->ecdev); - goto err_out; + if (tp->ecdev) { + i = ecdev_open(tp->ecdev); + if (i) { + ecdev_withdraw(tp->ecdev); + goto err_out; + } } return 0;