]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/niu.c
niu: BUG on inability to find page in rx page hashes.
[net-next-2.6.git] / drivers / net / niu.c
index 30abb4e436f16ed70b3aa85487d59441fad6a313..b9b950845b0e7d480a020f997f6707b89258f13e 100644 (file)
@@ -3330,10 +3330,12 @@ static struct page *niu_find_rxpage(struct rx_ring_info *rp, u64 addr,
        for (; (p = *pp) != NULL; pp = (struct page **) &p->mapping) {
                if (p->index == addr) {
                        *link = pp;
-                       break;
+                       goto found;
                }
        }
+       BUG();
 
+found:
        return p;
 }
 
@@ -7920,14 +7922,7 @@ static int niu_phys_id(struct net_device *dev, u32 data)
 
 static int niu_set_flags(struct net_device *dev, u32 data)
 {
-       if (data & (ETH_FLAG_LRO | ETH_FLAG_NTUPLE))
-               return -EOPNOTSUPP;
-
-       if (data & ETH_FLAG_RXHASH)
-               dev->features |= NETIF_F_RXHASH;
-       else
-               dev->features &= ~NETIF_F_RXHASH;
-       return 0;
+       return ethtool_op_set_flags(dev, data, ETH_FLAG_RXHASH);
 }
 
 static const struct ethtool_ops niu_ethtool_ops = {
@@ -9115,7 +9110,7 @@ static int __devinit niu_n2_irq_init(struct niu *np, u8 *ldg_num_map)
        const u32 *int_prop;
        int i;
 
-       int_prop = of_get_property(op->node, "interrupts", NULL);
+       int_prop = of_get_property(op->dev.of_node, "interrupts", NULL);
        if (!int_prop)
                return -ENODEV;
 
@@ -9266,7 +9261,7 @@ static int __devinit niu_get_of_props(struct niu *np)
        int prop_len;
 
        if (np->parent->plat_type == PLAT_TYPE_NIU)
-               dp = np->op->node;
+               dp = np->op->dev.of_node;
        else
                dp = pci_device_to_OF_node(np->pdev);
 
@@ -10083,10 +10078,10 @@ static int __devinit niu_of_probe(struct of_device *op,
 
        niu_driver_version();
 
-       reg = of_get_property(op->node, "reg", NULL);
+       reg = of_get_property(op->dev.of_node, "reg", NULL);
        if (!reg) {
                dev_err(&op->dev, "%s: No 'reg' property, aborting\n",
-                       op->node->full_name);
+                       op->dev.of_node->full_name);
                return -ENODEV;
        }
 
@@ -10099,7 +10094,7 @@ static int __devinit niu_of_probe(struct of_device *op,
        np = netdev_priv(dev);
 
        memset(&parent_id, 0, sizeof(parent_id));
-       parent_id.of = of_get_parent(op->node);
+       parent_id.of = of_get_parent(op->dev.of_node);
 
        np->parent = niu_get_parent(np, &parent_id,
                                    PLAT_TYPE_NIU);
@@ -10234,8 +10229,11 @@ static const struct of_device_id niu_match[] = {
 MODULE_DEVICE_TABLE(of, niu_match);
 
 static struct of_platform_driver niu_of_driver = {
-       .name           = "niu",
-       .match_table    = niu_match,
+       .driver = {
+               .name = "niu",
+               .owner = THIS_MODULE,
+               .of_match_table = niu_match,
+       },
        .probe          = niu_of_probe,
        .remove         = __devexit_p(niu_of_remove),
 };