diff options
Diffstat (limited to 'arch/powerpc/platforms/powermac/feature.c')
-rw-r--r-- | arch/powerpc/platforms/powermac/feature.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c index e6c0040ee797..fbc9bbd74dbd 100644 --- a/arch/powerpc/platforms/powermac/feature.c +++ b/arch/powerpc/platforms/powermac/feature.c | |||
@@ -2419,13 +2419,13 @@ static int __init probe_motherboard(void) | |||
2419 | dt = of_find_node_by_name(NULL, "device-tree"); | 2419 | dt = of_find_node_by_name(NULL, "device-tree"); |
2420 | if (dt != NULL) | 2420 | if (dt != NULL) |
2421 | model = of_get_property(dt, "model", NULL); | 2421 | model = of_get_property(dt, "model", NULL); |
2422 | for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) { | 2422 | for(i=0; model && i<ARRAY_SIZE(pmac_mb_defs); i++) { |
2423 | if (strcmp(model, pmac_mb_defs[i].model_string) == 0) { | 2423 | if (strcmp(model, pmac_mb_defs[i].model_string) == 0) { |
2424 | pmac_mb = pmac_mb_defs[i]; | 2424 | pmac_mb = pmac_mb_defs[i]; |
2425 | goto found; | 2425 | goto found; |
2426 | } | 2426 | } |
2427 | } | 2427 | } |
2428 | for(i=0; i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) { | 2428 | for(i=0; i<ARRAY_SIZE(pmac_mb_defs); i++) { |
2429 | if (machine_is_compatible(pmac_mb_defs[i].model_string)) { | 2429 | if (machine_is_compatible(pmac_mb_defs[i].model_string)) { |
2430 | pmac_mb = pmac_mb_defs[i]; | 2430 | pmac_mb = pmac_mb_defs[i]; |
2431 | goto found; | 2431 | goto found; |
@@ -2589,9 +2589,16 @@ static void __init probe_uninorth(void) | |||
2589 | if (address == 0) | 2589 | if (address == 0) |
2590 | return; | 2590 | return; |
2591 | uninorth_base = ioremap(address, 0x40000); | 2591 | uninorth_base = ioremap(address, 0x40000); |
2592 | if (uninorth_base == NULL) | ||
2593 | return; | ||
2592 | uninorth_rev = in_be32(UN_REG(UNI_N_VERSION)); | 2594 | uninorth_rev = in_be32(UN_REG(UNI_N_VERSION)); |
2593 | if (uninorth_maj == 3 || uninorth_maj == 4) | 2595 | if (uninorth_maj == 3 || uninorth_maj == 4) { |
2594 | u3_ht_base = ioremap(address + U3_HT_CONFIG_BASE, 0x1000); | 2596 | u3_ht_base = ioremap(address + U3_HT_CONFIG_BASE, 0x1000); |
2597 | if (u3_ht_base == NULL) { | ||
2598 | iounmap(uninorth_base); | ||
2599 | return; | ||
2600 | } | ||
2601 | } | ||
2595 | 2602 | ||
2596 | printk(KERN_INFO "Found %s memory controller & host bridge" | 2603 | printk(KERN_INFO "Found %s memory controller & host bridge" |
2597 | " @ 0x%08x revision: 0x%02x\n", uninorth_maj == 3 ? "U3" : | 2604 | " @ 0x%08x revision: 0x%02x\n", uninorth_maj == 3 ? "U3" : |