Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[POWERPC] mv64x60: Remove device tree absolute path references

Replace several device node absolute path lookups in the mv64x60
bootwrapper code with lookups by compatible or device_type
properties.

Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Acked-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Dale Farnsworth and committed by
Paul Mackerras
a05ce88a a1810b44

+15 -14
+2 -2
arch/powerpc/boot/mv64x60.c
··· 535 535 u32 v[2]; 536 536 void *devp; 537 537 538 - devp = finddevice("/mv64x60"); 538 + devp = find_node_by_compatible(NULL, "marvell,mv64360"); 539 539 if (devp == NULL) 540 540 goto err_out; 541 541 if (getprop(devp, "reg", v, sizeof(v)) != sizeof(v)) ··· 553 553 u32 v; 554 554 void *devp; 555 555 556 - devp = finddevice("/mv64x60"); 556 + devp = find_node_by_compatible(NULL, "marvell,mv64360"); 557 557 if (devp == NULL) 558 558 goto err_out; 559 559 if (getprop(devp, "virtual-reg", &v, sizeof(v)) != sizeof(v))
+1 -1
arch/powerpc/boot/mv64x60_i2c.c
··· 185 185 u32 v; 186 186 void *devp; 187 187 188 - devp = finddevice("/mv64x60/i2c"); 188 + devp = find_node_by_compatible(NULL, "marvell,mv64360-i2c"); 189 189 if (devp == NULL) 190 190 goto err_out; 191 191 if (getprop(devp, "virtual-reg", &v, sizeof(v)) != sizeof(v))
+12 -11
arch/powerpc/boot/prpmc2800.c
··· 344 344 acc_bits); 345 345 346 346 /* Get the cpu -> pci i/o & mem mappings from the device tree */ 347 - devp = finddevice("/mv64x60/pci@80000000"); 347 + devp = find_node_by_compatible(NULL, "marvell,mv64360-pci"); 348 348 if (devp == NULL) 349 - fatal("Error: Missing /mv64x60/pci@80000000" 349 + fatal("Error: Missing marvell,mv64360-pci" 350 350 " device tree node\n\r"); 351 351 352 352 rc = getprop(devp, "ranges", v, sizeof(v)); 353 353 if (rc != sizeof(v)) 354 - fatal("Error: Can't find /mv64x60/pci@80000000/ranges" 354 + fatal("Error: Can't find marvell,mv64360-pci ranges" 355 355 " property\n\r"); 356 356 357 357 /* Get the cpu -> pci i/o & mem mappings from the device tree */ 358 - devp = finddevice("/mv64x60"); 358 + devp = find_node_by_compatible(NULL, "marvell,mv64360"); 359 359 if (devp == NULL) 360 - fatal("Error: Missing /mv64x60 device tree node\n\r"); 360 + fatal("Error: Missing marvell,mv64360 device tree node\n\r"); 361 361 362 362 enables = in_le32((u32 *)(bridge_base + MV64x60_CPU_BAR_ENABLE)); 363 363 enables |= 0x0007fe00; /* Disable all cpu->pci windows */ ··· 429 429 setprop(devp, "model", model, l); 430 430 431 431 /* Set /cpus/PowerPC,7447/clock-frequency */ 432 - devp = finddevice("/cpus/PowerPC,7447"); 432 + devp = find_node_by_prop_value_str(NULL, "device_type", "cpu"); 433 433 if (devp == NULL) 434 - fatal("Error: Missing proper /cpus device tree node\n\r"); 434 + fatal("Error: Missing proper cpu device tree node\n\r"); 435 435 v[0] = bip->core_speed; 436 436 setprop(devp, "clock-frequency", &v[0], sizeof(v[0])); 437 437 ··· 443 443 v[1] = bip->mem_size; 444 444 setprop(devp, "reg", v, sizeof(v)); 445 445 446 - /* Update /mv64x60/model, if this is a mv64362 */ 446 + /* Update model, if this is a mv64362 */ 447 447 if (bip->bridge_type == BRIDGE_TYPE_MV64362) { 448 - devp = finddevice("/mv64x60"); 448 + devp = find_node_by_compatible(NULL, "marvell,mv64360"); 449 449 if (devp == NULL) 450 - fatal("Error: Missing /mv64x60 device tree node\n\r"); 450 + fatal("Error: Missing marvell,mv64360" 451 + " device tree node\n\r"); 451 452 setprop(devp, "model", "mv64362", strlen("mv64362") + 1); 452 453 } 453 454 454 455 /* Set User FLASH size */ 455 - devp = finddevice("/mv64x60/flash@a0000000"); 456 + devp = find_node_by_compatible(NULL, "direct-mapped"); 456 457 if (devp == NULL) 457 458 fatal("Error: Missing User FLASH device tree node\n\r"); 458 459 rc = getprop(devp, "reg", v, sizeof(v));