perf_counter: Simplify context cleanup
[safe/jmp/linux-2.6] / drivers / net / smc911x.c
index 9a16a79..2936103 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;
@@ -439,7 +439,6 @@ static inline void   smc911x_rcv(struct net_device *dev)
 
                DBG(SMC_DEBUG_PKTS, "%s: Received packet\n", dev->name);
                PRINT_PKT(data, ((pkt_len - 4) <= 64) ? pkt_len - 4 : 64);
-               dev->last_rx = jiffies;
                skb->protocol = eth_type_trans(skb, dev);
                netif_rx(skb);
                dev->stats.rx_packets++;
@@ -1231,7 +1230,6 @@ smc911x_rx_dma_irq(int dma, void *data)
        BUG_ON(skb == NULL);
        lp->current_rx_skb = NULL;
        PRINT_PKT(skb->data, skb->len);
-       dev->last_rx = jiffies;
        skb->protocol = eth_type_trans(skb, dev);
        dev->stats.rx_packets++;
        dev->stats.rx_bytes += skb->len;
@@ -1547,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)
@@ -2050,9 +2048,6 @@ err_out:
  */
 static int __devinit smc911x_drv_probe(struct platform_device *pdev)
 {
-#ifdef SMC_DYNAMIC_BUS_CONFIG
-       struct smc911x_platdata *pd = pdev->dev.platform_data;
-#endif
        struct net_device *ndev;
        struct resource *res;
        struct smc911x_local *lp;
@@ -2087,11 +2082,14 @@ static int __devinit smc911x_drv_probe(struct platform_device *pdev)
        lp = netdev_priv(ndev);
        lp->netdev = ndev;
 #ifdef SMC_DYNAMIC_BUS_CONFIG
-       if (!pd) {
-               ret = -EINVAL;
-               goto release_both;
+       {
+               struct smc911x_platdata *pd = pdev->dev.platform_data;
+               if (!pd) {
+                       ret = -EINVAL;
+                       goto release_both;
+               }
+               memcpy(&lp->cfg, pd, sizeof(lp->cfg));
        }
-       memcpy(&lp->cfg, pd, sizeof(lp->cfg));
 #endif
 
        addr = ioremap(res->start, SMC911X_IO_EXTENT);