drivers/net: Omit check for multicast bit in netdev_for_each_mc_addr
[linux-2.6.git] / drivers / net / sunbmac.c
index ed7865a..297a424 100644 (file)
@@ -97,7 +97,7 @@ static int qec_global_reset(void __iomem *gregs)
 
 static void qec_init(struct bigmac *bp)
 {
-       struct of_device *qec_op = bp->qec_op;
+       struct platform_device *qec_op = bp->qec_op;
        void __iomem *gregs = bp->gregs;
        u8 bsizes = bp->bigmac_bursts;
        u32 regval;
@@ -362,7 +362,7 @@ static void bigmac_tcvr_write(struct bigmac *bp, void __iomem *tregs,
        default:
                printk(KERN_ERR "bigmac_tcvr_read: Whoops, no known transceiver type.\n");
                return;
-       };
+       }
 
        idle_transceiver(tregs);
        write_tcvr_bit(bp, tregs, 0);
@@ -401,7 +401,7 @@ static unsigned short bigmac_tcvr_read(struct bigmac *bp,
        default:
                printk(KERN_ERR "bigmac_tcvr_read: Whoops, no known transceiver type.\n");
                return 0xffff;
-       };
+       }
 
        idle_transceiver(tregs);
        write_tcvr_bit(bp, tregs, 0);
@@ -617,7 +617,7 @@ static void bigmac_begin_auto_negotiation(struct bigmac *bp)
        bp->timer_ticks = 0;
        bp->bigmac_timer.expires = jiffies + (12 * HZ) / 10;
        bp->bigmac_timer.data = (unsigned long) bp;
-       bp->bigmac_timer.function = &bigmac_timer;
+       bp->bigmac_timer.function = bigmac_timer;
        add_timer(&bp->bigmac_timer);
 }
 
@@ -982,8 +982,6 @@ static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
        sbus_writel(CREG_CTRL_TWAKEUP, bp->creg + CREG_CTRL);
 
 
-       dev->trans_start = jiffies;
-
        return NETDEV_TX_OK;
 }
 
@@ -999,8 +997,7 @@ static void bigmac_set_multicast(struct net_device *dev)
 {
        struct bigmac *bp = netdev_priv(dev);
        void __iomem *bregs = bp->bregs;
-       struct dev_mc_list *dmi;
-       char *addrs;
+       struct netdev_hw_addr *ha;
        int i;
        u32 tmp, crc;
 
@@ -1028,13 +1025,8 @@ static void bigmac_set_multicast(struct net_device *dev)
                for (i = 0; i < 4; i++)
                        hash_table[i] = 0;
 
-               netdev_for_each_mc_addr(dmi, dev) {
-                       addrs = dmi->dmi_addr;
-
-                       if (!(*addrs & 1))
-                               continue;
-
-                       crc = ether_crc_le(6, addrs);
+               netdev_for_each_mc_addr(ha, dev) {
+                       crc = ether_crc_le(6, ha->addr);
                        crc >>= 26;
                        hash_table[crc >> 4] |= 1 << (crc & 0xf);
                }
@@ -1085,8 +1077,8 @@ static const struct net_device_ops bigmac_ops = {
        .ndo_validate_addr      = eth_validate_addr,
 };
 
-static int __devinit bigmac_ether_init(struct of_device *op,
-                                      struct of_device *qec_op)
+static int __devinit bigmac_ether_init(struct platform_device *op,
+                                      struct platform_device *qec_op)
 {
        static int version_printed;
        struct net_device *dev;
@@ -1133,8 +1125,8 @@ static int __devinit bigmac_ether_init(struct of_device *op,
                goto fail_and_cleanup;
 
        /* Get supported SBUS burst sizes. */
-       bsizes = of_getintprop_default(qec_op->node, "burst-sizes", 0xff);
-       bsizes_more = of_getintprop_default(qec_op->node, "burst-sizes", 0xff);
+       bsizes = of_getintprop_default(qec_op->dev.of_node, "burst-sizes", 0xff);
+       bsizes_more = of_getintprop_default(qec_op->dev.of_node, "burst-sizes", 0xff);
 
        bsizes &= 0xff;
        if (bsizes_more != 0xff)
@@ -1186,7 +1178,7 @@ static int __devinit bigmac_ether_init(struct of_device *op,
        }
 
        /* Get the board revision of this BigMAC. */
-       bp->board_rev = of_getintprop_default(bp->bigmac_op->node,
+       bp->board_rev = of_getintprop_default(bp->bigmac_op->dev.of_node,
                                              "board-version", 1);
 
        /* Init auto-negotiation timer state. */
@@ -1203,7 +1195,7 @@ static int __devinit bigmac_ether_init(struct of_device *op,
        dev->watchdog_timeo = 5*HZ;
 
        /* Finish net device registration. */
-       dev->irq = bp->bigmac_op->irqs[0];
+       dev->irq = bp->bigmac_op->archdata.irqs[0];
        dev->dma = 0;
 
        if (register_netdev(dev)) {
@@ -1244,25 +1236,24 @@ fail_and_cleanup:
 /* QEC can be the parent of either QuadEthernet or a BigMAC.  We want
  * the latter.
  */
-static int __devinit bigmac_sbus_probe(struct of_device *op,
-                                      const struct of_device_id *match)
+static int __devinit bigmac_sbus_probe(struct platform_device *op)
 {
        struct device *parent = op->dev.parent;
-       struct of_device *qec_op;
+       struct platform_device *qec_op;
 
-       qec_op = to_of_device(parent);
+       qec_op = to_platform_device(parent);
 
        return bigmac_ether_init(op, qec_op);
 }
 
-static int __devexit bigmac_sbus_remove(struct of_device *op)
+static int __devexit bigmac_sbus_remove(struct platform_device *op)
 {
        struct bigmac *bp = dev_get_drvdata(&op->dev);
        struct device *parent = op->dev.parent;
        struct net_device *net_dev = bp->dev;
-       struct of_device *qec_op;
+       struct platform_device *qec_op;
 
-       qec_op = to_of_device(parent);
+       qec_op = to_platform_device(parent);
 
        unregister_netdev(net_dev);
 
@@ -1291,21 +1282,24 @@ static const struct of_device_id bigmac_sbus_match[] = {
 
 MODULE_DEVICE_TABLE(of, bigmac_sbus_match);
 
-static struct of_platform_driver bigmac_sbus_driver = {
-       .name           = "sunbmac",
-       .match_table    = bigmac_sbus_match,
+static struct platform_driver bigmac_sbus_driver = {
+       .driver = {
+               .name = "sunbmac",
+               .owner = THIS_MODULE,
+               .of_match_table = bigmac_sbus_match,
+       },
        .probe          = bigmac_sbus_probe,
        .remove         = __devexit_p(bigmac_sbus_remove),
 };
 
 static int __init bigmac_init(void)
 {
-       return of_register_driver(&bigmac_sbus_driver, &of_bus_type);
+       return platform_driver_register(&bigmac_sbus_driver);
 }
 
 static void __exit bigmac_exit(void)
 {
-       of_unregister_driver(&bigmac_sbus_driver);
+       platform_driver_unregister(&bigmac_sbus_driver);
 }
 
 module_init(bigmac_init);