Skip to content

Commit

Permalink
sunhme: Don't match PCI devices in SBUS probe.
Browse files Browse the repository at this point in the history
Unfortunately, the OF device tree nodes for SBUS and PCI
hme devices have the same device node name on some systems.

So if the name of the parent node isn't 'sbus', skip it.

Based upon an excellent report and detective work by
Meelis Roos and Eric Brower.

Signed-off-by: David S. Miller <davem@davemloft.net>
Tested-by: Meelis Roos <mroos@linux.ee>
  • Loading branch information
David S. Miller committed Feb 7, 2009
1 parent beeebc9 commit 0b492fc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/net/sunhme.c
Original file line number Diff line number Diff line change
Expand Up @@ -2629,6 +2629,14 @@ static int __devinit happy_meal_sbus_probe_one(struct of_device *op, int is_qfe)
int i, qfe_slot = -1;
int err = -ENODEV;

sbus_dp = to_of_device(op->dev.parent)->node;
if (is_qfe)
sbus_dp = to_of_device(op->dev.parent->parent)->node;

/* We can match PCI devices too, do not accept those here. */
if (strcmp(sbus_dp->name, "sbus"))
return err;

if (is_qfe) {
qp = quattro_sbus_find(op);
if (qp == NULL)
Expand Down Expand Up @@ -2734,10 +2742,6 @@ static int __devinit happy_meal_sbus_probe_one(struct of_device *op, int is_qfe)
if (qp != NULL)
hp->happy_flags |= HFLAG_QUATTRO;

sbus_dp = to_of_device(op->dev.parent)->node;
if (is_qfe)
sbus_dp = to_of_device(op->dev.parent->parent)->node;

/* Get the supported DVMA burst sizes from our Happy SBUS. */
hp->happy_bursts = of_getintprop_default(sbus_dp,
"burst-sizes", 0x00);
Expand Down

0 comments on commit 0b492fc

Please sign in to comment.