Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[safe/jmp/linux-2.6] / drivers / net / depca.c
index ec34f03..97ea2d6 100644 (file)
@@ -566,6 +566,18 @@ MODULE_LICENSE("GPL");
     outw(CSR0, DEPCA_ADDR);\
     outw(STOP, DEPCA_DATA)
 
+static const struct net_device_ops depca_netdev_ops = {
+       .ndo_open               = depca_open,
+       .ndo_start_xmit         = depca_start_xmit,
+       .ndo_stop               = depca_close,
+       .ndo_set_multicast_list = set_multicast_list,
+       .ndo_do_ioctl           = depca_ioctl,
+       .ndo_tx_timeout         = depca_tx_timeout,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_validate_addr      = eth_validate_addr,
+};
+
 static int __init depca_hw_init (struct net_device *dev, struct device *device)
 {
        struct depca_private *lp;
@@ -606,8 +618,8 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
        if (!mem_start || lp->adapter < DEPCA || lp->adapter >=unknown)
                return -ENXIO;
 
-       printk ("%s: %s at 0x%04lx",
-               device->bus_id, depca_signature[lp->adapter], ioaddr);
+       printk("%s: %s at 0x%04lx",
+              dev_name(device), depca_signature[lp->adapter], ioaddr);
 
        switch (lp->depca_bus) {
 #ifdef CONFIG_MCA
@@ -669,7 +681,7 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
 
        spin_lock_init(&lp->lock);
        sprintf(lp->adapter_name, "%s (%s)",
-               depca_signature[lp->adapter], device->bus_id);
+               depca_signature[lp->adapter], dev_name(device));
        status = -EBUSY;
 
        /* Initialisation Block */
@@ -793,17 +805,12 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
        }
 
        /* The DEPCA-specific entries in the device structure. */
-       dev->open = &depca_open;
-       dev->hard_start_xmit = &depca_start_xmit;
-       dev->stop = &depca_close;
-       dev->set_multicast_list = &set_multicast_list;
-       dev->do_ioctl = &depca_ioctl;
-       dev->tx_timeout = depca_tx_timeout;
+       dev->netdev_ops = &depca_netdev_ops;
        dev->watchdog_timeo = TX_TIMEOUT;
 
        dev->mem_start = 0;
 
-       device->driver_data = dev;
+       dev_set_drvdata(device, dev);
        SET_NETDEV_DEV (dev, device);
 
        status = register_netdev(dev);
@@ -950,7 +957,7 @@ static int depca_start_xmit(struct sk_buff *skb, struct net_device *dev)
                if (TX_BUFFS_AVAIL)
                        netif_start_queue(dev);
        } else
-               status = -1;
+               status = NETDEV_TX_LOCKED;
 
       out:
        return status;
@@ -1556,6 +1563,7 @@ static int __init depca_isa_probe (struct platform_device *device)
 #ifdef CONFIG_EISA
 static int __init depca_eisa_probe (struct device *device)
 {
+       enum depca_type adapter = unknown;
        struct eisa_device *edev;
        struct net_device *dev;
        struct depca_private *lp;
@@ -1574,7 +1582,11 @@ static int __init depca_eisa_probe (struct device *device)
         * the EISA configuration structures (yet... :-), just rely on
         * the ISA probing to sort it out... */
 
-       depca_shmem_probe (&mem_start);
+       adapter = depca_shmem_probe (&mem_start);
+       if (adapter == unknown) {
+               status = -ENODEV;
+               goto out_free;
+       }
 
        dev->base_addr = ioaddr;
        dev->irq = irq;
@@ -1602,7 +1614,7 @@ static int __devexit depca_device_remove (struct device *device)
        struct depca_private *lp;
        int bus;
 
-       dev  = device->driver_data;
+       dev  = dev_get_drvdata(device);
        lp   = netdev_priv(dev);
 
        unregister_netdev (dev);
@@ -1827,7 +1839,7 @@ static int load_packet(struct net_device *dev, struct sk_buff *skb)
 
                lp->tx_new = (++end) & lp->txRingMask;  /* update current pointers */
        } else {
-               status = -1;
+               status = NETDEV_TX_LOCKED;
        }
 
        return status;