vsprintf: use TOLOWER whenever possible
[safe/jmp/linux-2.6] / drivers / net / korina.c
index 6df9d25..25e2af6 100644 (file)
@@ -400,7 +400,7 @@ static int korina_rx(struct net_device *dev, int limit)
                        dma_cache_inv((unsigned long)pkt_buf, pkt_len - 4);
 
                        /* Malloc up new buffer. */
-                       skb_new = netdev_alloc_skb(dev, KORINA_RBSIZE + 2);
+                       skb_new = netdev_alloc_skb_ip_align(dev, KORINA_RBSIZE);
 
                        if (!skb_new)
                                break;
@@ -417,9 +417,6 @@ static int korina_rx(struct net_device *dev, int limit)
                        if (devcs & ETH_RX_MP)
                                dev->stats.multicast++;
 
-                       /* 16 bit align */
-                       skb_reserve(skb_new, 2);
-
                        lp->rx_skb[lp->rx_next_done] = skb_new;
                }
 
@@ -743,14 +740,14 @@ static u32 netdev_get_link(struct net_device *dev)
        return mii_link_ok(&lp->mii_if);
 }
 
-static struct ethtool_ops netdev_ethtool_ops = {
+static const struct ethtool_ops netdev_ethtool_ops = {
        .get_drvinfo            = netdev_get_drvinfo,
        .get_settings           = netdev_get_settings,
        .set_settings           = netdev_set_settings,
        .get_link               = netdev_get_link,
 };
 
-static void korina_alloc_ring(struct net_device *dev)
+static int korina_alloc_ring(struct net_device *dev)
 {
        struct korina_private *lp = netdev_priv(dev);
        struct sk_buff *skb;
@@ -771,7 +768,7 @@ static void korina_alloc_ring(struct net_device *dev)
        for (i = 0; i < KORINA_NUM_RDS; i++) {
                skb = dev_alloc_skb(KORINA_RBSIZE + 2);
                if (!skb)
-                       break;
+                       return -ENOMEM;
                skb_reserve(skb, 2);
                lp->rx_skb[i] = skb;
                lp->rd_ring[i].control = DMA_DESC_IOD |
@@ -790,6 +787,8 @@ static void korina_alloc_ring(struct net_device *dev)
        lp->rx_chain_head = 0;
        lp->rx_chain_tail = 0;
        lp->rx_chain_status = desc_empty;
+
+       return 0;
 }
 
 static void korina_free_ring(struct net_device *dev)
@@ -832,7 +831,11 @@ static int korina_init(struct net_device *dev)
        writel(ETH_INT_FC_EN, &lp->eth_regs->ethintfc);
 
        /* Allocate rings */
-       korina_alloc_ring(dev);
+       if (korina_alloc_ring(dev)) {
+               printk(KERN_ERR "%s: descriptor allocation failed\n", dev->name);
+               korina_free_ring(dev);
+               return -ENOMEM;
+       }
 
        writel(0, &lp->rx_dma_regs->dmas);
        /* Start Rx DMA */
@@ -1011,14 +1014,14 @@ static int korina_open(struct net_device *dev)
        /* Install the interrupt handler
         * that handles the Done Finished
         * Ovr and Und Events */
-       ret = request_irq(lp->rx_irq, &korina_rx_dma_interrupt,
+       ret = request_irq(lp->rx_irq, korina_rx_dma_interrupt,
                        IRQF_DISABLED, "Korina ethernet Rx", dev);
        if (ret < 0) {
                printk(KERN_ERR "%s: unable to get Rx DMA IRQ %d\n",
                    dev->name, lp->rx_irq);
                goto err_release;
        }
-       ret = request_irq(lp->tx_irq, &korina_tx_dma_interrupt,
+       ret = request_irq(lp->tx_irq, korina_tx_dma_interrupt,
                        IRQF_DISABLED, "Korina ethernet Tx", dev);
        if (ret < 0) {
                printk(KERN_ERR "%s: unable to get Tx DMA IRQ %d\n",
@@ -1027,7 +1030,7 @@ static int korina_open(struct net_device *dev)
        }
 
        /* Install handler for overrun error. */
-       ret = request_irq(lp->ovr_irq, &korina_ovr_interrupt,
+       ret = request_irq(lp->ovr_irq, korina_ovr_interrupt,
                        IRQF_DISABLED, "Ethernet Overflow", dev);
        if (ret < 0) {
                printk(KERN_ERR "%s: unable to get OVR IRQ %d\n",
@@ -1036,7 +1039,7 @@ static int korina_open(struct net_device *dev)
        }
 
        /* Install handler for underflow error. */
-       ret = request_irq(lp->und_irq, &korina_und_interrupt,
+       ret = request_irq(lp->und_irq, korina_und_interrupt,
                        IRQF_DISABLED, "Ethernet Underflow", dev);
        if (ret < 0) {
                printk(KERN_ERR "%s: unable to get UND IRQ %d\n",