diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-09-19 01:56:44 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-09-19 01:56:44 -0400 |
commit | 0612ec48762bf8712db1925b2e67246d2237ebab (patch) | |
tree | 01b0d69c9c9915015c0f23ad4263646dd5413e99 /drivers/net/sunlance.c | |
parent | 4263cf0fac28122c8381b6f4f9441a43cd93c81f (diff) | |
parent | 47a5c6fa0e204a2b63309c648bb2fde36836c826 (diff) |
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/net/sunlance.c')
-rw-r--r-- | drivers/net/sunlance.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c index 1ef9fd39a79a..ec0413609f36 100644 --- a/drivers/net/sunlance.c +++ b/drivers/net/sunlance.c | |||
@@ -1537,7 +1537,7 @@ static int __init sparc_lance_init(void) | |||
1537 | { | 1537 | { |
1538 | if ((idprom->id_machtype == (SM_SUN4|SM_4_330)) || | 1538 | if ((idprom->id_machtype == (SM_SUN4|SM_4_330)) || |
1539 | (idprom->id_machtype == (SM_SUN4|SM_4_470))) { | 1539 | (idprom->id_machtype == (SM_SUN4|SM_4_470))) { |
1540 | memset(&sun4_sdev, 0, sizeof(sdev)); | 1540 | memset(&sun4_sdev, 0, sizeof(struct sbus_dev)); |
1541 | sun4_sdev.reg_addrs[0].phys_addr = sun4_eth_physaddr; | 1541 | sun4_sdev.reg_addrs[0].phys_addr = sun4_eth_physaddr; |
1542 | sun4_sdev.irqs[0] = 6; | 1542 | sun4_sdev.irqs[0] = 6; |
1543 | return sparc_lance_probe_one(&sun4_sdev, NULL, NULL); | 1543 | return sparc_lance_probe_one(&sun4_sdev, NULL, NULL); |
@@ -1547,16 +1547,16 @@ static int __init sparc_lance_init(void) | |||
1547 | 1547 | ||
1548 | static int __exit sunlance_sun4_remove(void) | 1548 | static int __exit sunlance_sun4_remove(void) |
1549 | { | 1549 | { |
1550 | struct lance_private *lp = dev_get_drvdata(&sun4_sdev->dev); | 1550 | struct lance_private *lp = dev_get_drvdata(&sun4_sdev.ofdev.dev); |
1551 | struct net_device *net_dev = lp->dev; | 1551 | struct net_device *net_dev = lp->dev; |
1552 | 1552 | ||
1553 | unregister_netdevice(net_dev); | 1553 | unregister_netdevice(net_dev); |
1554 | 1554 | ||
1555 | lance_free_hwresources(root_lance_dev); | 1555 | lance_free_hwresources(lp); |
1556 | 1556 | ||
1557 | free_netdev(net_dev); | 1557 | free_netdev(net_dev); |
1558 | 1558 | ||
1559 | dev_set_drvdata(&sun4_sdev->dev, NULL); | 1559 | dev_set_drvdata(&sun4_sdev.ofdev.dev, NULL); |
1560 | 1560 | ||
1561 | return 0; | 1561 | return 0; |
1562 | } | 1562 | } |
@@ -1566,20 +1566,21 @@ static int __exit sunlance_sun4_remove(void) | |||
1566 | static int __devinit sunlance_sbus_probe(struct of_device *dev, const struct of_device_id *match) | 1566 | static int __devinit sunlance_sbus_probe(struct of_device *dev, const struct of_device_id *match) |
1567 | { | 1567 | { |
1568 | struct sbus_dev *sdev = to_sbus_device(&dev->dev); | 1568 | struct sbus_dev *sdev = to_sbus_device(&dev->dev); |
1569 | struct device_node *dp = dev->node; | ||
1570 | int err; | 1569 | int err; |
1571 | 1570 | ||
1572 | if (!strcmp(dp->name, "le")) { | 1571 | if (sdev->parent) { |
1573 | err = sparc_lance_probe_one(sdev, NULL, NULL); | 1572 | struct of_device *parent = &sdev->parent->ofdev; |
1574 | } else if (!strcmp(dp->name, "ledma")) { | ||
1575 | struct sbus_dma *ledma = find_ledma(sdev); | ||
1576 | 1573 | ||
1577 | err = sparc_lance_probe_one(sdev->child, ledma, NULL); | 1574 | if (!strcmp(parent->node->name, "ledma")) { |
1578 | } else { | 1575 | struct sbus_dma *ledma = find_ledma(to_sbus_device(&parent->dev)); |
1579 | BUG_ON(strcmp(dp->name, "lebuffer")); | ||
1580 | 1576 | ||
1581 | err = sparc_lance_probe_one(sdev->child, NULL, sdev); | 1577 | err = sparc_lance_probe_one(sdev, ledma, NULL); |
1582 | } | 1578 | } else if (!strcmp(parent->node->name, "lebuffer")) { |
1579 | err = sparc_lance_probe_one(sdev, NULL, to_sbus_device(&parent->dev)); | ||
1580 | } else | ||
1581 | err = sparc_lance_probe_one(sdev, NULL, NULL); | ||
1582 | } else | ||
1583 | err = sparc_lance_probe_one(sdev, NULL, NULL); | ||
1583 | 1584 | ||
1584 | return err; | 1585 | return err; |
1585 | } | 1586 | } |
@@ -1604,12 +1605,6 @@ static struct of_device_id sunlance_sbus_match[] = { | |||
1604 | { | 1605 | { |
1605 | .name = "le", | 1606 | .name = "le", |
1606 | }, | 1607 | }, |
1607 | { | ||
1608 | .name = "ledma", | ||
1609 | }, | ||
1610 | { | ||
1611 | .name = "lebuffer", | ||
1612 | }, | ||
1613 | {}, | 1608 | {}, |
1614 | }; | 1609 | }; |
1615 | 1610 | ||