]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/gianfar.c
USB: use IRQF_DISABLED for HCD interrupt handlers
[linux-2.6-omap-h63xx.git] / drivers / net / gianfar.c
index 558440c15b6c47c183bc4d86bf6d87ef2984f5dd..0431e9ed0fac56681615a495f9f2c1a5f2d30040 100644 (file)
@@ -696,7 +696,7 @@ int startup_gfar(struct net_device *dev)
 {
        struct txbd8 *txbdp;
        struct rxbd8 *rxbdp;
-       dma_addr_t addr;
+       dma_addr_t addr = 0;
        unsigned long vaddr;
        int i;
        struct gfar_private *priv = netdev_priv(dev);
@@ -956,10 +956,12 @@ static int gfar_enet_open(struct net_device *dev)
        }
 
        err = startup_gfar(dev);
-       if (err)
+       if (err) {
 #ifdef CONFIG_GFAR_NAPI
                napi_disable(&priv->napi);
 #endif
+               return err;
+       }
 
        netif_start_queue(dev);
 
@@ -1237,8 +1239,6 @@ static int gfar_change_mtu(struct net_device *dev, int new_mtu)
  * starting over will fix the problem. */
 static void gfar_timeout(struct net_device *dev)
 {
-       struct gfar_private *priv = netdev_priv(dev);
-
        dev->stats.tx_errors++;
 
        if (dev->flags & IFF_UP) {
@@ -1344,8 +1344,9 @@ struct sk_buff * gfar_new_skb(struct net_device *dev, struct rxbd8 *bdp)
        return skb;
 }
 
-static inline void count_errors(unsigned short status, struct gfar_private *priv)
+static inline void count_errors(unsigned short status, struct net_device *dev)
 {
+       struct gfar_private *priv = netdev_priv(dev);
        struct net_device_stats *stats = &dev->stats;
        struct gfar_extra_stats *estats = &priv->extra_stats;
 
@@ -1539,7 +1540,7 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)
 
                        dev->stats.rx_bytes += pkt_len;
                } else {
-                       count_errors(bdp->status, priv);
+                       count_errors(bdp->status, dev);
 
                        if (skb)
                                dev_kfree_skb_any(skb);