diff options
author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2006-08-29 02:28:16 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-08-30 00:23:32 -0400 |
commit | 404dda854b8bb04df72405d5088fa3e6100aef36 (patch) | |
tree | 01d4eafea67712d473ef30159e3ad170bc74b5e9 /drivers | |
parent | 47f2c3604f47579ac5c173f8b402dc6cd8e2e8fa (diff) |
[SUNLANCE]: Fix probing problem.
The current probe table causes ledma and lebuffer
"le" devices to get probed twice which is not what
we want.
Match just "le" and look directly at the parent to get the correct
top-level node information.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/sunlance.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c index 0e3fdf7c6dd3..ec0413609f36 100644 --- a/drivers/net/sunlance.c +++ b/drivers/net/sunlance.c | |||
@@ -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 | ||