diff --git a/devices/e100-2.6.32-ethercat.c b/devices/e100-2.6.32-ethercat.c index 155e9b136975ada1d98f1a9abeb94b8360307aa9..ef562701aac73e687cea2738103a3586fc68ae3d 100644 --- a/devices/e100-2.6.32-ethercat.c +++ b/devices/e100-2.6.32-ethercat.c @@ -1,6 +1,6 @@ /****************************************************************************** * - * $Id$ + * $Id: e100-2.6.32-ethercat.c,v d05df15dcc6c 2011/09/22 16:51:31 fp $ * * Copyright (C) 2007-2008 Florian Pose, Ingenieurgemeinschaft IgH * @@ -2984,18 +2984,15 @@ 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)) { - ecdev_withdraw(nic->ecdev); - goto err_out_free; - } - } else { + + if (!nic->ecdev) { strcpy(netdev->name, "eth%d"); if((err = register_netdev(netdev))) { DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n"); goto err_out_free; } } + nic->cbs_pool = pci_pool_create(netdev->name, nic->pdev, nic->params.cbs.count * sizeof(struct cb), @@ -3005,6 +3002,13 @@ static int __devinit e100_probe(struct pci_dev *pdev, (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0), pdev->irq, netdev->dev_addr); + if (nic->ecdev) { + if (ecdev_open(nic->ecdev)) { + ecdev_withdraw(nic->ecdev); + goto err_out_free; + } + } + return 0; err_out_free: