Merge branch 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6
[safe/jmp/linux-2.6] / drivers / net / smc911x.c
index bf3aa2a..44ebbaa 100644 (file)
@@ -220,9 +220,9 @@ static void smc911x_reset(struct net_device *dev)
 
        /* make sure EEPROM has finished loading before setting GPIO_CFG */
        timeout=1000;
-       while ( timeout-- && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_)) {
+       while (--timeout && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_))
                udelay(10);
-       }
+
        if (timeout == 0){
                PRINTK("%s: smc911x_reset timeout waiting for EEPROM busy\n", dev->name);
                return;
@@ -553,7 +553,7 @@ static int smc911x_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
                dev->stats.tx_dropped++;
                spin_unlock_irqrestore(&lp->lock, flags);
                dev_kfree_skb(skb);
-               return 0;
+               return NETDEV_TX_OK;
        }
 
 #ifdef SMC_USE_DMA
@@ -566,7 +566,7 @@ static int smc911x_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
                        lp->pending_tx_skb = skb;
                        netif_stop_queue(dev);
                        spin_unlock_irqrestore(&lp->lock, flags);
-                       return 0;
+                       return NETDEV_TX_OK;
                } else {
                        DBG(SMC_DEBUG_TX | SMC_DEBUG_DMA, "%s: Activating Tx DMA\n", dev->name);
                        lp->txdma_active = 1;
@@ -577,7 +577,7 @@ static int smc911x_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
        smc911x_hardware_send_pkt(dev);
        spin_unlock_irqrestore(&lp->lock, flags);
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /*
@@ -1545,7 +1545,7 @@ smc911x_ethtool_getdrvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 {
        strncpy(info->driver, CARDNAME, sizeof(info->driver));
        strncpy(info->version, version, sizeof(info->version));
-       strncpy(info->bus_info, dev->dev.parent->bus_id, sizeof(info->bus_info));
+       strncpy(info->bus_info, dev_name(dev->dev.parent), sizeof(info->bus_info));
 }
 
 static int smc911x_ethtool_nwayreset(struct net_device *dev)
@@ -1774,6 +1774,20 @@ static int __devinit smc911x_findirq(struct net_device *dev)
        return probe_irq_off(cookie);
 }
 
+static const struct net_device_ops smc911x_netdev_ops = {
+       .ndo_open               = smc911x_open,
+       .ndo_stop               = smc911x_close,
+       .ndo_start_xmit         = smc911x_hard_start_xmit,
+       .ndo_tx_timeout         = smc911x_timeout,
+       .ndo_set_multicast_list = smc911x_set_multicast_list,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_validate_addr      = eth_validate_addr,
+       .ndo_set_mac_address    = eth_mac_addr,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       .ndo_poll_controller    = smc911x_poll_controller,
+#endif
+};
+
 /*
  * Function: smc911x_probe(unsigned long ioaddr)
  *
@@ -1940,16 +1954,9 @@ static int __devinit smc911x_probe(struct net_device *dev)
        /* Fill in the fields of the device structure with ethernet values. */
        ether_setup(dev);
 
-       dev->open = smc911x_open;
-       dev->stop = smc911x_close;
-       dev->hard_start_xmit = smc911x_hard_start_xmit;
-       dev->tx_timeout = smc911x_timeout;
+       dev->netdev_ops = &smc911x_netdev_ops;
        dev->watchdog_timeo = msecs_to_jiffies(watchdog);
-       dev->set_multicast_list = smc911x_set_multicast_list;
        dev->ethtool_ops = &smc911x_ethtool_ops;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       dev->poll_controller = smc911x_poll_controller;
-#endif
 
        INIT_WORK(&lp->phy_configure, smc911x_phy_configure);
        lp->mii.phy_id_mask = 0x1f;
@@ -1977,7 +1984,7 @@ static int __devinit smc911x_probe(struct net_device *dev)
 #endif
 
        /* Grab the IRQ */
-       retval = request_irq(dev->irq, &smc911x_interrupt,
+       retval = request_irq(dev->irq, smc911x_interrupt,
                             irq_flags, dev->name, dev);
        if (retval)
                goto err_out;