emac: Fix clock control for 405EX and 405EXr chips
[safe/jmp/linux-2.6] / drivers / net / sh_eth.c
index b39d1cc..7f8e514 100644 (file)
@@ -540,7 +540,6 @@ static int sh_eth_rx(struct net_device *ndev)
                        skb_put(skb, pkt_len);
                        skb->protocol = eth_type_trans(skb, ndev);
                        netif_rx(skb);
-                       ndev->last_rx = jiffies;
                        mdp->stats.rx_packets++;
                        mdp->stats.rx_bytes += pkt_len;
                }
@@ -800,7 +799,7 @@ static int sh_eth_phy_init(struct net_device *ndev)
        char phy_id[BUS_ID_SIZE];
        struct phy_device *phydev = NULL;
 
-       snprintf(phy_id, BUS_ID_SIZE, PHY_ID_FMT,
+       snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT,
                mdp->mii_bus->id , mdp->phy_id);
 
        mdp->link = PHY_DOWN;
@@ -927,7 +926,7 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
        struct sh_eth_private *mdp = netdev_priv(ndev);
        struct sh_eth_txdesc *txdesc;
        u32 entry;
-       int flags;
+       unsigned long flags;
 
        spin_lock_irqsave(&mdp->lock, flags);
        if ((mdp->cur_tx - mdp->dirty_tx) >= (TX_RING_SIZE - 4)) {
@@ -1141,7 +1140,7 @@ static int sh_mdio_init(struct net_device *ndev, int id)
        /* Hook up MII support for ethtool */
        mdp->mii_bus->name = "sh_mii";
        mdp->mii_bus->parent = &ndev->dev;
-       mdp->mii_bus->id[0] = id;
+       snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%x", id);
 
        /* PHY IRQ */
        mdp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
@@ -1205,11 +1204,12 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
                devno = 0;
 
        ndev->dma = -1;
-       ndev->irq = platform_get_irq(pdev, 0);
-       if (ndev->irq < 0) {
+       ret = platform_get_irq(pdev, 0);
+       if (ret < 0) {
                ret = -ENODEV;
                goto out_release;
        }
+       ndev->irq = ret;
 
        SET_NETDEV_DEV(ndev, &pdev->dev);