diff options
-rw-r--r-- | arch/sparc/kernel/sun4d_irq.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c index eaec8a90fb9f..1d13c5bda0b1 100644 --- a/arch/sparc/kernel/sun4d_irq.c +++ b/arch/sparc/kernel/sun4d_irq.c | |||
@@ -334,7 +334,8 @@ unsigned int sun4d_build_device_irq(struct platform_device *op, | |||
334 | unsigned int real_irq) | 334 | unsigned int real_irq) |
335 | { | 335 | { |
336 | struct device_node *dp = op->dev.of_node; | 336 | struct device_node *dp = op->dev.of_node; |
337 | struct device_node *io_unit, *sbi = dp->parent; | 337 | struct device_node *board_parent, *bus = dp->parent; |
338 | char *bus_connection; | ||
338 | const struct linux_prom_registers *regs; | 339 | const struct linux_prom_registers *regs; |
339 | unsigned int pil; | 340 | unsigned int pil; |
340 | unsigned int irq; | 341 | unsigned int irq; |
@@ -342,13 +343,20 @@ unsigned int sun4d_build_device_irq(struct platform_device *op, | |||
342 | int sbusl; | 343 | int sbusl; |
343 | 344 | ||
344 | irq = real_irq; | 345 | irq = real_irq; |
345 | while (sbi) { | 346 | while (bus) { |
346 | if (!strcmp(sbi->name, "sbi")) | 347 | if (!strcmp(bus->name, "sbi")) { |
348 | bus_connection = "io-unit"; | ||
347 | break; | 349 | break; |
350 | } | ||
351 | |||
352 | if (!strcmp(bus->name, "bootbus")) { | ||
353 | bus_connection = "cpu-unit"; | ||
354 | break; | ||
355 | } | ||
348 | 356 | ||
349 | sbi = sbi->parent; | 357 | bus = bus->parent; |
350 | } | 358 | } |
351 | if (!sbi) | 359 | if (!bus) |
352 | goto err_out; | 360 | goto err_out; |
353 | 361 | ||
354 | regs = of_get_property(dp, "reg", NULL); | 362 | regs = of_get_property(dp, "reg", NULL); |
@@ -358,17 +366,19 @@ unsigned int sun4d_build_device_irq(struct platform_device *op, | |||
358 | slot = regs->which_io; | 366 | slot = regs->which_io; |
359 | 367 | ||
360 | /* | 368 | /* |
361 | * If SBI's parent is not io-unit or the io-unit lacks | 369 | * If Bus nodes parent is not io-unit/cpu-unit or the io-unit/cpu-unit |
362 | * a "board#" property, something is very wrong. | 370 | * lacks a "board#" property, something is very wrong. |
363 | */ | 371 | */ |
364 | if (!sbi->parent || strcmp(sbi->parent->name, "io-unit")) { | 372 | if (!bus->parent || strcmp(bus->parent->name, bus_connection)) { |
365 | printk("%s: Error, parent is not io-unit.\n", sbi->full_name); | 373 | printk(KERN_ERR "%s: Error, parent is not %s.\n", |
374 | bus->full_name, bus_connection); | ||
366 | goto err_out; | 375 | goto err_out; |
367 | } | 376 | } |
368 | io_unit = sbi->parent; | 377 | board_parent = bus->parent; |
369 | board = of_getintprop_default(io_unit, "board#", -1); | 378 | board = of_getintprop_default(board_parent, "board#", -1); |
370 | if (board == -1) { | 379 | if (board == -1) { |
371 | printk("%s: Error, lacks board# property.\n", io_unit->full_name); | 380 | printk(KERN_ERR "%s: Error, lacks board# property.\n", |
381 | board_parent->full_name); | ||
372 | goto err_out; | 382 | goto err_out; |
373 | } | 383 | } |
374 | 384 | ||