if (*linkp == NULL)
return;
+ if (link->dev)
+ unregister_netdev(dev);
+
if (link->state & DEV_CONFIG)
pcnet_release(link);
/* Unlink device structure, free bits */
*linkp = link->next;
- if (link->dev)
- unregister_netdev(dev);
free_netdev(dev);
} /* pcnet_detach */
switch (event) {
case CS_EVENT_CARD_REMOVAL:
link->state &= ~DEV_PRESENT;
- if (link->state & DEV_CONFIG) {
+ if (link->state & DEV_CONFIG)
netif_device_detach(dev);
- pcnet_release(link);
- }
break;
case CS_EVENT_CARD_INSERTION:
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
pcnet_dev_t *info = PRIV(dev);
- u16 *data = (u16 *)&rq->ifr_data;
+ u16 *data = (u16 *)&rq->ifr_ifru;
ioaddr_t mii_addr = dev->base_addr + DLINK_GPIO;
switch (cmd) {
case SIOCGMIIPHY: