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

[POWERPC] powermac: Constify & voidify get_property()

Now that get_property() returns a void *, there's no need to cast its
return value. Also, treat the return value as const, so we can
constify get_property later.

powermac platform & macintosh driver changes.

Built for pmac32_defconfig, g5_defconfig

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Jeremy Kerr and committed by
Paul Mackerras
018a3d1d eeb2b723

+166 -158
+2 -1
arch/powerpc/platforms/powermac/backlight.c
··· 38 38 struct device_node* bk_node = find_devices("backlight"); 39 39 40 40 if (bk_node) { 41 - char *prop = get_property(bk_node, "backlight-control", NULL); 41 + const char *prop = get_property(bk_node, 42 + "backlight-control", NULL); 42 43 if (prop && strncmp(prop, type, strlen(type)) == 0) 43 44 return 1; 44 45 }
+12 -11
arch/powerpc/platforms/powermac/cpufreq_32.c
··· 421 421 422 422 static u32 read_gpio(struct device_node *np) 423 423 { 424 - u32 *reg = (u32 *)get_property(np, "reg", NULL); 424 + const u32 *reg = get_property(np, "reg", NULL); 425 425 u32 offset; 426 426 427 427 if (reg == NULL) ··· 497 497 "frequency-gpio"); 498 498 struct device_node *slew_done_gpio_np = of_find_node_by_name(NULL, 499 499 "slewing-done"); 500 - u32 *value; 500 + const u32 *value; 501 501 502 502 /* 503 503 * Check to see if it's GPIO driven or PMU only ··· 519 519 */ 520 520 if (frequency_gpio && slew_done_gpio) { 521 521 int lenp, rc; 522 - u32 *freqs, *ratio; 522 + const u32 *freqs, *ratio; 523 523 524 - freqs = (u32 *)get_property(cpunode, "bus-frequencies", &lenp); 524 + freqs = get_property(cpunode, "bus-frequencies", &lenp); 525 525 lenp /= sizeof(u32); 526 526 if (freqs == NULL || lenp != 2) { 527 527 printk(KERN_ERR "cpufreq: bus-frequencies incorrect or missing\n"); 528 528 return 1; 529 529 } 530 - ratio = (u32 *)get_property(cpunode, "processor-to-bus-ratio*2", NULL); 530 + ratio = get_property(cpunode, "processor-to-bus-ratio*2", NULL); 531 531 if (ratio == NULL) { 532 532 printk(KERN_ERR "cpufreq: processor-to-bus-ratio*2 missing\n"); 533 533 return 1; ··· 562 562 /* If we use the PMU, look for the min & max frequencies in the 563 563 * device-tree 564 564 */ 565 - value = (u32 *)get_property(cpunode, "min-clock-frequency", NULL); 565 + value = get_property(cpunode, "min-clock-frequency", NULL); 566 566 if (!value) 567 567 return 1; 568 568 low_freq = (*value) / 1000; ··· 571 571 if (low_freq < 100000) 572 572 low_freq *= 10; 573 573 574 - value = (u32 *)get_property(cpunode, "max-clock-frequency", NULL); 574 + value = get_property(cpunode, "max-clock-frequency", NULL); 575 575 if (!value) 576 576 return 1; 577 577 hi_freq = (*value) / 1000; ··· 611 611 static int pmac_cpufreq_init_750FX(struct device_node *cpunode) 612 612 { 613 613 struct device_node *volt_gpio_np; 614 - u32 pvr, *value; 614 + u32 pvr; 615 + const u32 *value; 615 616 616 617 if (get_property(cpunode, "dynamic-power-step", NULL) == NULL) 617 618 return 1; 618 619 619 620 hi_freq = cur_freq; 620 - value = (u32 *)get_property(cpunode, "reduced-clock-frequency", NULL); 621 + value = get_property(cpunode, "reduced-clock-frequency", NULL); 621 622 if (!value) 622 623 return 1; 623 624 low_freq = (*value) / 1000; ··· 651 650 static int __init pmac_cpufreq_setup(void) 652 651 { 653 652 struct device_node *cpunode; 654 - u32 *value; 653 + const u32 *value; 655 654 656 655 if (strstr(cmd_line, "nocpufreq")) 657 656 return 0; ··· 662 661 goto out; 663 662 664 663 /* Get current cpu clock freq */ 665 - value = (u32 *)get_property(cpunode, "clock-frequency", NULL); 664 + value = get_property(cpunode, "clock-frequency", NULL); 666 665 if (!value) 667 666 goto out; 668 667 cur_freq = (*value) / 1000;
+14 -13
arch/powerpc/platforms/powermac/cpufreq_64.c
··· 89 89 90 90 #ifdef CONFIG_PPC_SMU 91 91 92 - static u32 *g5_pmode_data; 92 + static const u32 *g5_pmode_data; 93 93 static int g5_pmode_max; 94 94 95 95 static struct smu_sdbp_fvt *g5_fvt_table; /* table of op. points */ ··· 391 391 unsigned int psize, ssize; 392 392 unsigned long max_freq; 393 393 char *freq_method, *volt_method; 394 - u32 *valp, pvr_hi; 394 + const u32 *valp; 395 + u32 pvr_hi; 395 396 int use_volts_vdnap = 0; 396 397 int use_volts_smu = 0; 397 398 int rc = -ENODEV; ··· 410 409 /* Get first CPU node */ 411 410 for (cpunode = NULL; 412 411 (cpunode = of_get_next_child(cpus, cpunode)) != NULL;) { 413 - u32 *reg = 414 - (u32 *)get_property(cpunode, "reg", NULL); 412 + const u32 *reg = get_property(cpunode, "reg", NULL); 415 413 if (reg == NULL || (*reg) != 0) 416 414 continue; 417 415 if (!strcmp(cpunode->type, "cpu")) ··· 422 422 } 423 423 424 424 /* Check 970FX for now */ 425 - valp = (u32 *)get_property(cpunode, "cpu-version", NULL); 425 + valp = get_property(cpunode, "cpu-version", NULL); 426 426 if (!valp) { 427 427 DBG("No cpu-version property !\n"); 428 428 goto bail_noprops; ··· 434 434 } 435 435 436 436 /* Look for the powertune data in the device-tree */ 437 - g5_pmode_data = (u32 *)get_property(cpunode, "power-mode-data",&psize); 437 + g5_pmode_data = get_property(cpunode, "power-mode-data",&psize); 438 438 if (!g5_pmode_data) { 439 439 DBG("No power-mode-data !\n"); 440 440 goto bail_noprops; ··· 442 442 g5_pmode_max = psize / sizeof(u32) - 1; 443 443 444 444 if (use_volts_smu) { 445 - struct smu_sdbp_header *shdr; 445 + const struct smu_sdbp_header *shdr; 446 446 447 447 /* Look for the FVT table */ 448 448 shdr = smu_get_sdb_partition(SMU_SDB_FVT_ID, NULL); ··· 493 493 * half freq in this version. So far, I haven't yet seen a machine 494 494 * supporting anything else. 495 495 */ 496 - valp = (u32 *)get_property(cpunode, "clock-frequency", NULL); 496 + valp = get_property(cpunode, "clock-frequency", NULL); 497 497 if (!valp) 498 498 return -ENODEV; 499 499 max_freq = (*valp)/1000; ··· 541 541 static int __init g5_pm72_cpufreq_init(struct device_node *cpus) 542 542 { 543 543 struct device_node *cpuid = NULL, *hwclock = NULL, *cpunode = NULL; 544 - u8 *eeprom = NULL; 545 - u32 *valp; 544 + const u8 *eeprom = NULL; 545 + const u32 *valp; 546 546 u64 max_freq, min_freq, ih, il; 547 547 int has_volt = 1, rc = 0; 548 548 ··· 563 563 /* Lookup the cpuid eeprom node */ 564 564 cpuid = of_find_node_by_path("/u3@0,f8000000/i2c@f8001000/cpuid@a0"); 565 565 if (cpuid != NULL) 566 - eeprom = (u8 *)get_property(cpuid, "cpuid", NULL); 566 + eeprom = get_property(cpuid, "cpuid", NULL); 567 567 if (eeprom == NULL) { 568 568 printk(KERN_ERR "cpufreq: Can't find cpuid EEPROM !\n"); 569 569 rc = -ENODEV; ··· 573 573 /* Lookup the i2c hwclock */ 574 574 for (hwclock = NULL; 575 575 (hwclock = of_find_node_by_name(hwclock, "i2c-hwclock")) != NULL;){ 576 - char *loc = get_property(hwclock, "hwctrl-location", NULL); 576 + const char *loc = get_property(hwclock, 577 + "hwctrl-location", NULL); 577 578 if (loc == NULL) 578 579 continue; 579 580 if (strcmp(loc, "CPU CLOCK")) ··· 638 637 */ 639 638 640 639 /* Get max frequency from device-tree */ 641 - valp = (u32 *)get_property(cpunode, "clock-frequency", NULL); 640 + valp = get_property(cpunode, "clock-frequency", NULL); 642 641 if (!valp) { 643 642 printk(KERN_ERR "cpufreq: Can't find CPU frequency !\n"); 644 643 rc = -ENODEV;
+15 -15
arch/powerpc/platforms/powermac/feature.c
··· 1058 1058 if (np == NULL) 1059 1059 return -ENODEV; 1060 1060 for (np = np->child; np != NULL; np = np->sibling) { 1061 - u32 *num = (u32 *)get_property(np, "reg", NULL); 1062 - u32 *rst = (u32 *)get_property(np, "soft-reset", NULL); 1061 + u32 *num = get_property(np, "reg", NULL); 1062 + u32 *rst = get_property(np, "soft-reset", NULL); 1063 1063 if (num == NULL || rst == NULL) 1064 1064 continue; 1065 1065 if (param == *num) { ··· 1087 1087 { 1088 1088 struct macio_chip *macio; 1089 1089 unsigned long flags; 1090 - char *prop; 1090 + const char *prop; 1091 1091 int number; 1092 1092 u32 reg; 1093 1093 ··· 1096 1096 macio->type != macio_intrepid) 1097 1097 return -ENODEV; 1098 1098 1099 - prop = (char *)get_property(node, "AAPL,clock-id", NULL); 1099 + prop = get_property(node, "AAPL,clock-id", NULL); 1100 1100 if (!prop) 1101 1101 return -ENODEV; 1102 1102 if (strncmp(prop, "usb0u048", 8) == 0) ··· 1507 1507 if (np == NULL) 1508 1508 return -ENODEV; 1509 1509 for (np = np->child; np != NULL; np = np->sibling) { 1510 - u32 *num = (u32 *)get_property(np, "reg", NULL); 1511 - u32 *rst = (u32 *)get_property(np, "soft-reset", NULL); 1510 + const u32 *num = get_property(np, "reg", NULL); 1511 + const u32 *rst = get_property(np, "soft-reset", NULL); 1512 1512 if (num == NULL || rst == NULL) 1513 1513 continue; 1514 1514 if (param == *num) { ··· 2408 2408 */ 2409 2409 dt = find_devices("device-tree"); 2410 2410 if (dt != NULL) 2411 - model = (const char *) get_property(dt, "model", NULL); 2411 + model = get_property(dt, "model", NULL); 2412 2412 for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) { 2413 2413 if (strcmp(model, pmac_mb_defs[i].model_string) == 0) { 2414 2414 pmac_mb = pmac_mb_defs[i]; ··· 2536 2536 */ 2537 2537 static void __init probe_uninorth(void) 2538 2538 { 2539 - u32 *addrp; 2539 + const u32 *addrp; 2540 2540 phys_addr_t address; 2541 2541 unsigned long actrl; 2542 2542 ··· 2555 2555 if (uninorth_node == NULL) 2556 2556 return; 2557 2557 2558 - addrp = (u32 *)get_property(uninorth_node, "reg", NULL); 2558 + addrp = get_property(uninorth_node, "reg", NULL); 2559 2559 if (addrp == NULL) 2560 2560 return; 2561 2561 address = of_translate_address(uninorth_node, addrp); ··· 2596 2596 struct device_node* node; 2597 2597 int i; 2598 2598 volatile u32 __iomem *base; 2599 - u32 *addrp, *revp; 2599 + const u32 *addrp, *revp; 2600 2600 phys_addr_t addr; 2601 2601 u64 size; 2602 2602 ··· 2639 2639 return; 2640 2640 } 2641 2641 if (type == macio_keylargo || type == macio_keylargo2) { 2642 - u32 *did = (u32 *)get_property(node, "device-id", NULL); 2642 + const u32 *did = get_property(node, "device-id", NULL); 2643 2643 if (*did == 0x00000025) 2644 2644 type = macio_pangea; 2645 2645 if (*did == 0x0000003e) ··· 2652 2652 macio_chips[i].base = base; 2653 2653 macio_chips[i].flags = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON; 2654 2654 macio_chips[i].name = macio_names[type]; 2655 - revp = (u32 *)get_property(node, "revision-id", NULL); 2655 + revp = get_property(node, "revision-id", NULL); 2656 2656 if (revp) 2657 2657 macio_chips[i].rev = *revp; 2658 2658 printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n", ··· 2695 2695 initial_serial_shutdown(struct device_node *np) 2696 2696 { 2697 2697 int len; 2698 - struct slot_names_prop { 2698 + const struct slot_names_prop { 2699 2699 int count; 2700 2700 char name[1]; 2701 2701 } *slots; 2702 - char *conn; 2702 + const char *conn; 2703 2703 int port_type = PMAC_SCC_ASYNC; 2704 2704 int modem = 0; 2705 2705 2706 - slots = (struct slot_names_prop *)get_property(np, "slot-names", &len); 2706 + slots = get_property(np, "slot-names", &len); 2707 2707 conn = get_property(np, "AAPL,connector", &len); 2708 2708 if (conn && (strcmp(conn, "infrared") == 0)) 2709 2709 port_type = PMAC_SCC_IRDA;
+12 -12
arch/powerpc/platforms/powermac/low_i2c.c
··· 477 477 static struct pmac_i2c_host_kw *__init kw_i2c_host_init(struct device_node *np) 478 478 { 479 479 struct pmac_i2c_host_kw *host; 480 - u32 *psteps, *prate, *addrp, steps; 480 + const u32 *psteps, *prate, *addrp; 481 + u32 steps; 481 482 482 483 host = kzalloc(sizeof(struct pmac_i2c_host_kw), GFP_KERNEL); 483 484 if (host == NULL) { ··· 491 490 * on all i2c keywest nodes so far ... we would have to fallback 492 491 * to macio parsing if that wasn't the case 493 492 */ 494 - addrp = (u32 *)get_property(np, "AAPL,address", NULL); 493 + addrp = get_property(np, "AAPL,address", NULL); 495 494 if (addrp == NULL) { 496 495 printk(KERN_ERR "low_i2c: Can't find address for %s\n", 497 496 np->full_name); ··· 505 504 host->timeout_timer.function = kw_i2c_timeout; 506 505 host->timeout_timer.data = (unsigned long)host; 507 506 508 - psteps = (u32 *)get_property(np, "AAPL,address-step", NULL); 507 + psteps = get_property(np, "AAPL,address-step", NULL); 509 508 steps = psteps ? (*psteps) : 0x10; 510 509 for (host->bsteps = 0; (steps & 0x01) == 0; host->bsteps++) 511 510 steps >>= 1; 512 511 /* Select interface rate */ 513 512 host->speed = KW_I2C_MODE_25KHZ; 514 - prate = (u32 *)get_property(np, "AAPL,i2c-rate", NULL); 513 + prate = get_property(np, "AAPL,i2c-rate", NULL); 515 514 if (prate) switch(*prate) { 516 515 case 100: 517 516 host->speed = KW_I2C_MODE_100KHZ; ··· 619 618 } else { 620 619 for (child = NULL; 621 620 (child = of_get_next_child(np, child)) != NULL;) { 622 - u32 *reg = 623 - (u32 *)get_property(child, "reg", NULL); 621 + const u32 *reg = get_property(child, 622 + "reg", NULL); 624 623 if (reg == NULL) 625 624 continue; 626 625 kw_i2c_add(host, np, child, *reg); ··· 882 881 { 883 882 struct device_node *controller, *busnode; 884 883 struct pmac_i2c_bus *bus; 885 - u32 *reg; 884 + const u32 *reg; 886 885 int sz; 887 886 888 887 if (!smu_present()) ··· 905 904 if (strcmp(busnode->type, "i2c") && 906 905 strcmp(busnode->type, "i2c-bus")) 907 906 continue; 908 - reg = (u32 *)get_property(busnode, "reg", NULL); 907 + reg = get_property(busnode, "reg", NULL); 909 908 if (reg == NULL) 910 909 continue; 911 910 ··· 949 948 list_for_each_entry(bus, &pmac_i2c_busses, link) { 950 949 if (p == bus->busnode) { 951 950 if (prev && bus->flags & pmac_i2c_multibus) { 952 - u32 *reg; 953 - reg = (u32 *)get_property(prev, "reg", 954 - NULL); 951 + const u32 *reg; 952 + reg = get_property(prev, "reg", NULL); 955 953 if (!reg) 956 954 continue; 957 955 if (((*reg) >> 8) != bus->channel) ··· 971 971 972 972 u8 pmac_i2c_get_dev_addr(struct device_node *device) 973 973 { 974 - u32 *reg = (u32 *)get_property(device, "reg", NULL); 974 + const u32 *reg = get_property(device, "reg", NULL); 975 975 976 976 if (reg == NULL) 977 977 return 0;
+20 -17
arch/powerpc/platforms/powermac/pci.c
··· 69 69 static int __init fixup_one_level_bus_range(struct device_node *node, int higher) 70 70 { 71 71 for (; node != 0;node = node->sibling) { 72 - int * bus_range; 73 - unsigned int *class_code; 72 + const int * bus_range; 73 + const unsigned int *class_code; 74 74 int len; 75 75 76 76 /* For PCI<->PCI bridges or CardBus bridges, we go down */ 77 - class_code = (unsigned int *) get_property(node, "class-code", NULL); 77 + class_code = get_property(node, "class-code", NULL); 78 78 if (!class_code || ((*class_code >> 8) != PCI_CLASS_BRIDGE_PCI && 79 79 (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) 80 80 continue; 81 - bus_range = (int *) get_property(node, "bus-range", &len); 81 + bus_range = get_property(node, "bus-range", &len); 82 82 if (bus_range != NULL && len > 2 * sizeof(int)) { 83 83 if (bus_range[1] > higher) 84 84 higher = bus_range[1]; ··· 96 96 */ 97 97 static void __init fixup_bus_range(struct device_node *bridge) 98 98 { 99 - int * bus_range; 100 - int len; 99 + int *bus_range, len; 100 + struct property *prop; 101 101 102 102 /* Lookup the "bus-range" property for the hose */ 103 - bus_range = (int *) get_property(bridge, "bus-range", &len); 104 - if (bus_range == NULL || len < 2 * sizeof(int)) 103 + prop = of_find_property(bridge, "bus-range", &len); 104 + if (prop == NULL || prop->length < 2 * sizeof(int)) 105 105 return; 106 + 107 + bus_range = (int *)prop->value; 106 108 bus_range[1] = fixup_one_level_bus_range(bridge->child, bus_range[1]); 107 109 } 108 110 ··· 242 240 static int chaos_validate_dev(struct pci_bus *bus, int devfn, int offset) 243 241 { 244 242 struct device_node *np; 245 - u32 *vendor, *device; 243 + const u32 *vendor, *device; 246 244 247 245 if (offset >= 0x100) 248 246 return PCIBIOS_BAD_REGISTER_NUMBER; ··· 250 248 if (np == NULL) 251 249 return PCIBIOS_DEVICE_NOT_FOUND; 252 250 253 - vendor = (u32 *)get_property(np, "vendor-id", NULL); 254 - device = (u32 *)get_property(np, "device-id", NULL); 251 + vendor = get_property(np, "vendor-id", NULL); 252 + device = get_property(np, "device-id", NULL); 255 253 if (vendor == NULL || device == NULL) 256 254 return PCIBIOS_DEVICE_NOT_FOUND; 257 255 ··· 691 689 692 690 for (nec = NULL; (nec = of_find_node_by_name(nec, "usb")) != NULL;) { 693 691 struct pci_controller *hose; 694 - u32 data, *prop; 692 + u32 data; 693 + const u32 *prop; 695 694 u8 bus, devfn; 696 695 697 - prop = (u32 *)get_property(nec, "vendor-id", NULL); 696 + prop = get_property(nec, "vendor-id", NULL); 698 697 if (prop == NULL) 699 698 continue; 700 699 if (0x1033 != *prop) 701 700 continue; 702 - prop = (u32 *)get_property(nec, "device-id", NULL); 701 + prop = get_property(nec, "device-id", NULL); 703 702 if (prop == NULL) 704 703 continue; 705 704 if (0x0035 != *prop) 706 705 continue; 707 - prop = (u32 *)get_property(nec, "reg", NULL); 706 + prop = get_property(nec, "reg", NULL); 708 707 if (prop == NULL) 709 708 continue; 710 709 devfn = (prop[0] >> 8) & 0xff; ··· 904 901 struct pci_controller *hose; 905 902 struct resource rsrc; 906 903 char *disp_name; 907 - int *bus_range; 904 + const int *bus_range; 908 905 int primary = 1, has_address = 0; 909 906 910 907 DBG("Adding PCI host bridge %s\n", dev->full_name); ··· 913 910 has_address = (of_address_to_resource(dev, 0, &rsrc) == 0); 914 911 915 912 /* Get bus range if any */ 916 - bus_range = (int *) get_property(dev, "bus-range", &len); 913 + bus_range = get_property(dev, "bus-range", &len); 917 914 if (bus_range == NULL || len < 2 * sizeof(int)) { 918 915 printk(KERN_WARNING "Can't get bus-range for %s, assume" 919 916 " bus 0\n", dev->full_name);
+1 -1
arch/powerpc/platforms/powermac/pfunc_base.c
··· 114 114 * we just create them all 115 115 */ 116 116 for (gp = NULL; (gp = of_get_next_child(gparent, gp)) != NULL;) { 117 - u32 *reg = (u32 *)get_property(gp, "reg", NULL); 117 + const u32 *reg = get_property(gp, "reg", NULL); 118 118 unsigned long offset; 119 119 if (reg == NULL) 120 120 continue;
+3 -2
arch/powerpc/platforms/powermac/pfunc_core.c
··· 813 813 struct pmf_device *dev; 814 814 struct pmf_function *func, *result = NULL; 815 815 char fname[64]; 816 - u32 *prop, ph; 816 + const u32 *prop; 817 + u32 ph; 817 818 818 819 /* 819 820 * Look for a "platform-*" function reference. If we can't find 820 821 * one, then we fallback to a direct call attempt 821 822 */ 822 823 snprintf(fname, 63, "platform-%s", name); 823 - prop = (u32 *)get_property(target, fname, NULL); 824 + prop = get_property(target, fname, NULL); 824 825 if (prop == NULL) 825 826 goto find_it; 826 827 ph = *prop;
+8 -10
arch/powerpc/platforms/powermac/setup.c
··· 116 116 static void pmac_show_cpuinfo(struct seq_file *m) 117 117 { 118 118 struct device_node *np; 119 - char *pp; 119 + const char *pp; 120 120 int plen; 121 121 int mbmodel; 122 122 unsigned int mbflags; ··· 134 134 seq_printf(m, "machine\t\t: "); 135 135 np = of_find_node_by_path("/"); 136 136 if (np != NULL) { 137 - pp = (char *) get_property(np, "model", NULL); 137 + pp = get_property(np, "model", NULL); 138 138 if (pp != NULL) 139 139 seq_printf(m, "%s\n", pp); 140 140 else 141 141 seq_printf(m, "PowerMac\n"); 142 - pp = (char *) get_property(np, "compatible", &plen); 142 + pp = get_property(np, "compatible", &plen); 143 143 if (pp != NULL) { 144 144 seq_printf(m, "motherboard\t:"); 145 145 while (plen > 0) { ··· 163 163 if (np == NULL) 164 164 np = of_find_node_by_type(NULL, "cache"); 165 165 if (np != NULL) { 166 - unsigned int *ic = (unsigned int *) 167 - get_property(np, "i-cache-size", NULL); 168 - unsigned int *dc = (unsigned int *) 169 - get_property(np, "d-cache-size", NULL); 166 + const unsigned int *ic = get_property(np, "i-cache-size", NULL); 167 + const unsigned int *dc = get_property(np, "d-cache-size", NULL); 170 168 seq_printf(m, "L2 cache\t:"); 171 169 has_l2cache = 1; 172 170 if (get_property(np, "cache-unified", NULL) != 0 && dc) { ··· 252 254 if (np == 0) 253 255 np = find_type_devices("cpu"); 254 256 if (np != 0) { 255 - unsigned int *l2cr = (unsigned int *) 257 + const unsigned int *l2cr = 256 258 get_property(np, "l2cr-value", NULL); 257 259 if (l2cr != 0) { 258 260 ppc_override_l2cr = 1; ··· 275 277 static void __init pmac_setup_arch(void) 276 278 { 277 279 struct device_node *cpu, *ic; 278 - int *fp; 280 + const int *fp; 279 281 unsigned long pvr; 280 282 281 283 pvr = PVR_VER(mfspr(SPRN_PVR)); ··· 285 287 loops_per_jiffy = 50000000 / HZ; 286 288 cpu = of_find_node_by_type(NULL, "cpu"); 287 289 if (cpu != NULL) { 288 - fp = (int *) get_property(cpu, "clock-frequency", NULL); 290 + fp = get_property(cpu, "clock-frequency", NULL); 289 291 if (fp != NULL) { 290 292 if (pvr >= 0x30 && pvr < 0x80) 291 293 /* PPC970 etc. */
+3 -4
arch/powerpc/platforms/powermac/smp.c
··· 548 548 struct device_node *cc = NULL; 549 549 struct device_node *p; 550 550 const char *name = NULL; 551 - u32 *reg; 551 + const u32 *reg; 552 552 int ok; 553 553 554 554 /* Look for the clock chip */ ··· 562 562 pmac_tb_clock_chip_host = pmac_i2c_find_bus(cc); 563 563 if (pmac_tb_clock_chip_host == NULL) 564 564 continue; 565 - reg = (u32 *)get_property(cc, "reg", NULL); 565 + reg = get_property(cc, "reg", NULL); 566 566 if (reg == NULL) 567 567 continue; 568 568 switch (*reg) { ··· 707 707 core99_tb_gpio = KL_GPIO_TB_ENABLE; /* default value */ 708 708 cpu = of_find_node_by_type(NULL, "cpu"); 709 709 if (cpu != NULL) { 710 - tbprop = (u32 *)get_property(cpu, "timebase-enable", 711 - NULL); 710 + tbprop = get_property(cpu, "timebase-enable", NULL); 712 711 if (tbprop) 713 712 core99_tb_gpio = *tbprop; 714 713 of_node_put(cpu);
+5 -5
arch/powerpc/platforms/powermac/udbg_scc.c
··· 68 68 69 69 void udbg_scc_init(int force_scc) 70 70 { 71 - u32 *reg; 71 + const u32 *reg; 72 72 unsigned long addr; 73 73 struct device_node *stdout = NULL, *escc = NULL, *macio = NULL; 74 74 struct device_node *ch, *ch_def = NULL, *ch_a = NULL; 75 - char *path; 75 + const char *path; 76 76 int i, x; 77 77 78 78 escc = of_find_node_by_name(NULL, "escc"); ··· 81 81 macio = of_get_parent(escc); 82 82 if (macio == NULL) 83 83 goto bail; 84 - path = (char *)get_property(of_chosen, "linux,stdout-path", NULL); 84 + path = get_property(of_chosen, "linux,stdout-path", NULL); 85 85 if (path != NULL) 86 86 stdout = of_find_node_by_path(path); 87 87 for (ch = NULL; (ch = of_get_next_child(escc, ch)) != NULL;) { ··· 96 96 ch = ch_def ? ch_def : ch_a; 97 97 98 98 /* Get address within mac-io ASIC */ 99 - reg = (u32 *)get_property(escc, "reg", NULL); 99 + reg = get_property(escc, "reg", NULL); 100 100 if (reg == NULL) 101 101 goto bail; 102 102 addr = reg[0]; 103 103 104 104 /* Get address of mac-io PCI itself */ 105 - reg = (u32 *)get_property(macio, "assigned-addresses", NULL); 105 + reg = get_property(macio, "assigned-addresses", NULL); 106 106 if (reg == NULL) 107 107 goto bail; 108 108 addr += reg[2];
+2 -1
drivers/i2c/busses/i2c-powermac.c
··· 209 209 struct pmac_i2c_bus *bus = dev->platform_data; 210 210 struct device_node *parent = NULL; 211 211 struct i2c_adapter *adapter; 212 - char name[32], *basename; 212 + char name[32]; 213 + const char *basename; 213 214 int rc; 214 215 215 216 if (bus == NULL)
+3 -3
drivers/ide/ppc/pmac.c
··· 1154 1154 pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif) 1155 1155 { 1156 1156 struct device_node *np = pmif->node; 1157 - int *bidp; 1157 + const int *bidp; 1158 1158 1159 1159 pmif->cable_80 = 0; 1160 1160 pmif->broken_dma = pmif->broken_dma_warn = 0; ··· 1176 1176 pmif->broken_dma = 1; 1177 1177 } 1178 1178 1179 - bidp = (int *)get_property(np, "AAPL,bus-id", NULL); 1179 + bidp = get_property(np, "AAPL,bus-id", NULL); 1180 1180 pmif->aapl_bus_id = bidp ? *bidp : 0; 1181 1181 1182 1182 /* Get cable type from device-tree */ 1183 1183 if (pmif->kind == controller_kl_ata4 || pmif->kind == controller_un_ata6 1184 1184 || pmif->kind == controller_k2_ata6 1185 1185 || pmif->kind == controller_sh_ata6) { 1186 - char* cable = get_property(np, "cable-type", NULL); 1186 + const char* cable = get_property(np, "cable-type", NULL); 1187 1187 if (cable && !strncmp(cable, "80-", 3)) 1188 1188 pmif->cable_80 = 1; 1189 1189 }
+6 -4
drivers/macintosh/macio_asic.c
··· 139 139 { 140 140 struct macio_dev * macio_dev; 141 141 struct of_device * of; 142 - char *scratch, *compat, *compat2; 142 + char *scratch; 143 + const char *compat, *compat2; 144 + 143 145 int i = 0; 144 146 int length, cplen, cplen2, seen = 0; 145 147 ··· 175 173 * it's not really legal to split it out with commas. We split it 176 174 * up using a number of environment variables instead. */ 177 175 178 - compat = (char *) get_property(of->node, "compatible", &cplen); 176 + compat = get_property(of->node, "compatible", &cplen); 179 177 compat2 = compat; 180 178 cplen2= cplen; 181 179 while (compat && cplen > 0) { ··· 456 454 struct resource *parent_res) 457 455 { 458 456 struct macio_dev *dev; 459 - u32 *reg; 457 + const u32 *reg; 460 458 461 459 if (np == NULL) 462 460 return NULL; ··· 491 489 #endif 492 490 MAX_NODE_NAME_SIZE, np->name); 493 491 } else { 494 - reg = (u32 *)get_property(np, "reg", NULL); 492 + reg = get_property(np, "reg", NULL); 495 493 sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s", 496 494 chip->lbus.index, 497 495 reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name);
+4 -4
drivers/macintosh/macio_sysfs.c
··· 16 16 compatible_show (struct device *dev, struct device_attribute *attr, char *buf) 17 17 { 18 18 struct of_device *of; 19 - char *compat; 19 + const char *compat; 20 20 int cplen; 21 21 int length = 0; 22 22 23 23 of = &to_macio_device (dev)->ofdev; 24 - compat = (char *) get_property(of->node, "compatible", &cplen); 24 + compat = get_property(of->node, "compatible", &cplen); 25 25 if (!compat) { 26 26 *buf = '\0'; 27 27 return 0; ··· 42 42 char *buf) 43 43 { 44 44 struct of_device *of; 45 - char *compat; 45 + const char *compat; 46 46 int cplen; 47 47 int length; 48 48 49 49 of = &to_macio_device (dev)->ofdev; 50 - compat = (char *) get_property (of->node, "compatible", &cplen); 50 + compat = get_property(of->node, "compatible", &cplen); 51 51 if (!compat) compat = "", cplen = 1; 52 52 length = sprintf (buf, "of:N%sT%s", of->node->name, of->node->type); 53 53 buf += length;
+9 -10
drivers/macintosh/smu.c
··· 447 447 int __init smu_init (void) 448 448 { 449 449 struct device_node *np; 450 - u32 *data; 450 + const u32 *data; 451 451 452 452 np = of_find_node_by_type(NULL, "smu"); 453 453 if (np == NULL) ··· 483 483 printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n"); 484 484 goto fail; 485 485 } 486 - data = (u32 *)get_property(np, "reg", NULL); 486 + data = get_property(np, "reg", NULL); 487 487 if (data == NULL) { 488 488 of_node_put(np); 489 489 printk(KERN_ERR "SMU: Can't find doorbell GPIO address !\n"); ··· 506 506 np = of_find_node_by_name(NULL, "smu-interrupt"); 507 507 if (np == NULL) 508 508 break; 509 - data = (u32 *)get_property(np, "reg", NULL); 509 + data = get_property(np, "reg", NULL); 510 510 if (data == NULL) { 511 511 of_node_put(np); 512 512 break; ··· 959 959 /* Note: Only allowed to return error code in pointers (using ERR_PTR) 960 960 * when interruptible is 1 961 961 */ 962 - struct smu_sdbp_header *__smu_get_sdb_partition(int id, unsigned int *size, 963 - int interruptible) 962 + const struct smu_sdbp_header *__smu_get_sdb_partition(int id, 963 + unsigned int *size, int interruptible) 964 964 { 965 965 char pname[32]; 966 - struct smu_sdbp_header *part; 966 + const struct smu_sdbp_header *part; 967 967 968 968 if (!smu) 969 969 return NULL; ··· 980 980 } else 981 981 mutex_lock(&smu_part_access); 982 982 983 - part = (struct smu_sdbp_header *)get_property(smu->of_node, 984 - pname, size); 983 + part = get_property(smu->of_node, pname, size); 985 984 if (part == NULL) { 986 985 DPRINTK("trying to extract from SMU ...\n"); 987 986 part = smu_create_sdb_partition(id); ··· 991 992 return part; 992 993 } 993 994 994 - struct smu_sdbp_header *smu_get_sdb_partition(int id, unsigned int *size) 995 + const struct smu_sdbp_header *smu_get_sdb_partition(int id, unsigned int *size) 995 996 { 996 997 return __smu_get_sdb_partition(id, size, 0); 997 998 } ··· 1070 1071 pp->mode = smu_file_events; 1071 1072 return 0; 1072 1073 } else if (hdr.cmdtype == SMU_CMDTYPE_GET_PARTITION) { 1073 - struct smu_sdbp_header *part; 1074 + const struct smu_sdbp_header *part; 1074 1075 part = __smu_get_sdb_partition(hdr.cmd, NULL, 1); 1075 1076 if (part == NULL) 1076 1077 return -EINVAL;
+4 -4
drivers/macintosh/therm_adt746x.c
··· 47 47 48 48 static u8 default_limits_local[3] = {70, 50, 70}; /* local, sensor1, sensor2 */ 49 49 static u8 default_limits_chip[3] = {80, 65, 80}; /* local, sensor1, sensor2 */ 50 - static char *sensor_location[3] = {NULL, NULL, NULL}; 50 + static const char *sensor_location[3] = {NULL, NULL, NULL}; 51 51 52 52 static int limit_adjust = 0; 53 53 static int fan_speed = -1; ··· 553 553 thermostat_init(void) 554 554 { 555 555 struct device_node* np; 556 - u32 *prop; 556 + const u32 *prop; 557 557 int i = 0, offset = 0; 558 558 559 559 np = of_find_node_by_name(NULL, "fan"); ··· 566 566 else 567 567 return -ENODEV; 568 568 569 - prop = (u32 *)get_property(np, "hwsensor-params-version", NULL); 569 + prop = get_property(np, "hwsensor-params-version", NULL); 570 570 printk(KERN_INFO "adt746x: version %d (%ssupported)\n", *prop, 571 571 (*prop == 1)?"":"un"); 572 572 if (*prop != 1) 573 573 return -ENODEV; 574 574 575 - prop = (u32 *)get_property(np, "reg", NULL); 575 + prop = get_property(np, "reg", NULL); 576 576 if (!prop) 577 577 return -ENODEV; 578 578
+7 -7
drivers/macintosh/therm_pm72.c
··· 660 660 { 661 661 struct device_node *np; 662 662 char nodename[64]; 663 - u8 *data; 663 + const u8 *data; 664 664 int len; 665 665 666 666 /* prom.c routine for finding a node by path is a bit brain dead ··· 673 673 printk(KERN_ERR "therm_pm72: Failed to retrieve cpuid node from device-tree\n"); 674 674 return -ENODEV; 675 675 } 676 - data = (u8 *)get_property(np, "cpuid", &len); 676 + data = get_property(np, "cpuid", &len); 677 677 if (data == NULL) { 678 678 printk(KERN_ERR "therm_pm72: Failed to retrieve cpuid property from device-tree\n"); 679 679 of_node_put(np); ··· 1336 1336 */ 1337 1337 u3 = of_find_node_by_path("/u3@0,f8000000"); 1338 1338 if (u3 != NULL) { 1339 - u32 *vers = (u32 *)get_property(u3, "device-rev", NULL); 1339 + const u32 *vers = get_property(u3, "device-rev", NULL); 1340 1340 if (vers) 1341 1341 if (((*vers) & 0x3f) < 0x34) 1342 1342 u3h = 0; ··· 2111 2111 2112 2112 while ((np = of_get_next_child(fcu_node, np)) != NULL) { 2113 2113 int type = -1; 2114 - char *loc; 2115 - u32 *reg; 2114 + const char *loc; 2115 + const u32 *reg; 2116 2116 2117 2117 DBG(" control: %s, type: %s\n", np->name, np->type); 2118 2118 ··· 2128 2128 continue; 2129 2129 2130 2130 /* Lookup for a matching location */ 2131 - loc = (char *)get_property(np, "location", NULL); 2132 - reg = (u32 *)get_property(np, "reg", NULL); 2131 + loc = get_property(np, "location", NULL); 2132 + reg = get_property(np, "reg", NULL); 2133 2133 if (loc == NULL || reg == NULL) 2134 2134 continue; 2135 2135 DBG(" matching location: %s, reg: 0x%08x\n", loc, *reg);
+2 -2
drivers/macintosh/therm_windtunnel.c
··· 484 484 static int __init 485 485 g4fan_init( void ) 486 486 { 487 - struct apple_thermal_info *info; 487 + const struct apple_thermal_info *info; 488 488 struct device_node *np; 489 489 490 490 init_MUTEX( &x.lock ); 491 491 492 492 if( !(np=of_find_node_by_name(NULL, "power-mgt")) ) 493 493 return -ENODEV; 494 - info = (struct apple_thermal_info*)get_property(np, "thermal-info", NULL); 494 + info = get_property(np, "thermal-info", NULL); 495 495 of_node_put(np); 496 496 497 497 if( !info || !machine_is_compatible("PowerMac3,6") )
+2 -2
drivers/macintosh/via-cuda.c
··· 123 123 { 124 124 struct adb_request req; 125 125 phys_addr_t taddr; 126 - u32 *reg; 126 + const u32 *reg; 127 127 int err; 128 128 129 129 if (vias != 0) ··· 132 132 if (vias == 0) 133 133 return 0; 134 134 135 - reg = (u32 *)get_property(vias, "reg", NULL); 135 + reg = get_property(vias, "reg", NULL); 136 136 if (reg == NULL) { 137 137 printk(KERN_ERR "via-cuda: No \"reg\" property !\n"); 138 138 goto fail;
+1 -1
drivers/macintosh/via-pmu-led.c
··· 120 120 dt = of_find_node_by_path("/"); 121 121 if (dt == NULL) 122 122 return -ENODEV; 123 - model = (const char *)get_property(dt, "model", NULL); 123 + model = get_property(dt, "model", NULL); 124 124 if (model == NULL) 125 125 return -ENODEV; 126 126 if (strncmp(model, "PowerBook", strlen("PowerBook")) != 0 &&
+5 -5
drivers/macintosh/via-pmu.c
··· 287 287 int __init find_via_pmu(void) 288 288 { 289 289 u64 taddr; 290 - u32 *reg; 290 + const u32 *reg; 291 291 292 292 if (via != 0) 293 293 return 1; ··· 295 295 if (vias == NULL) 296 296 return 0; 297 297 298 - reg = (u32 *)get_property(vias, "reg", NULL); 298 + reg = get_property(vias, "reg", NULL); 299 299 if (reg == NULL) { 300 300 printk(KERN_ERR "via-pmu: No \"reg\" property !\n"); 301 301 goto fail; ··· 337 337 338 338 gpiop = of_find_node_by_name(NULL, "gpio"); 339 339 if (gpiop) { 340 - reg = (u32 *)get_property(gpiop, "reg", NULL); 340 + reg = get_property(gpiop, "reg", NULL); 341 341 if (reg) 342 342 gaddr = of_translate_address(gpiop, reg); 343 343 if (gaddr != OF_BAD_ADDR) ··· 486 486 pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART; 487 487 } else { 488 488 struct device_node* prim = find_devices("power-mgt"); 489 - u32 *prim_info = NULL; 489 + const u32 *prim_info = NULL; 490 490 if (prim) 491 - prim_info = (u32 *)get_property(prim, "prim-info", NULL); 491 + prim_info = get_property(prim, "prim-info", NULL); 492 492 if (prim_info) { 493 493 /* Other stuffs here yet unknown */ 494 494 pmu_battery_count = (prim_info[6] >> 16) & 0xff;
+2 -2
drivers/macintosh/windfarm_pm81.c
··· 396 396 static void wf_smu_create_cpu_fans(void) 397 397 { 398 398 struct wf_cpu_pid_param pid_param; 399 - struct smu_sdbp_header *hdr; 399 + const struct smu_sdbp_header *hdr; 400 400 struct smu_sdbp_cpupiddata *piddata; 401 401 struct smu_sdbp_fvt *fvt; 402 402 s32 tmax, tdelta, maxpow, powadj; ··· 702 702 703 703 static int wf_init_pm(void) 704 704 { 705 - struct smu_sdbp_header *hdr; 705 + const struct smu_sdbp_header *hdr; 706 706 707 707 hdr = smu_get_sdb_partition(SMU_SDB_SENSORTREE_ID, NULL); 708 708 if (hdr != 0) {
+1 -1
drivers/macintosh/windfarm_pm91.c
··· 144 144 static void wf_smu_create_cpu_fans(void) 145 145 { 146 146 struct wf_cpu_pid_param pid_param; 147 - struct smu_sdbp_header *hdr; 147 + const struct smu_sdbp_header *hdr; 148 148 struct smu_sdbp_cpupiddata *piddata; 149 149 struct smu_sdbp_fvt *fvt; 150 150 s32 tmax, tdelta, maxpow, powadj;
+7 -6
drivers/macintosh/windfarm_smu_controls.c
··· 159 159 int pwm_fan) 160 160 { 161 161 struct smu_fan_control *fct; 162 - s32 *v; u32 *reg; 163 - char *l; 162 + const s32 *v; 163 + const u32 *reg; 164 + const char *l; 164 165 165 166 fct = kmalloc(sizeof(struct smu_fan_control), GFP_KERNEL); 166 167 if (fct == NULL) 167 168 return NULL; 168 169 fct->ctrl.ops = &smu_fan_ops; 169 - l = (char *)get_property(node, "location", NULL); 170 + l = get_property(node, "location", NULL); 170 171 if (l == NULL) 171 172 goto fail; 172 173 ··· 224 223 goto fail; 225 224 226 225 /* Get min & max values*/ 227 - v = (s32 *)get_property(node, "min-value", NULL); 226 + v = get_property(node, "min-value", NULL); 228 227 if (v == NULL) 229 228 goto fail; 230 229 fct->min = *v; 231 - v = (s32 *)get_property(node, "max-value", NULL); 230 + v = get_property(node, "max-value", NULL); 232 231 if (v == NULL) 233 232 goto fail; 234 233 fct->max = *v; 235 234 236 235 /* Get "reg" value */ 237 - reg = (u32 *)get_property(node, "reg", NULL); 236 + reg = get_property(node, "reg", NULL); 238 237 if (reg == NULL) 239 238 goto fail; 240 239 fct->reg = *reg;
+4 -4
drivers/macintosh/windfarm_smu_sat.c
··· 233 233 { 234 234 struct wf_sat *sat; 235 235 struct wf_sat_sensor *sens; 236 - u32 *reg; 237 - char *loc, *type; 236 + const u32 *reg; 237 + const char *loc, *type; 238 238 u8 addr, chip, core; 239 239 struct device_node *child; 240 240 int shift, cpu, index; 241 241 char *name; 242 242 int vsens[2], isens[2]; 243 243 244 - reg = (u32 *) get_property(dev, "reg", NULL); 244 + reg = get_property(dev, "reg", NULL); 245 245 if (reg == NULL) 246 246 return; 247 247 addr = *reg; ··· 268 268 isens[0] = isens[1] = -1; 269 269 child = NULL; 270 270 while ((child = of_get_next_child(dev, child)) != NULL) { 271 - reg = (u32 *) get_property(child, "reg", NULL); 271 + reg = get_property(child, "reg", NULL); 272 272 type = get_property(child, "device_type", NULL); 273 273 loc = get_property(child, "location", NULL); 274 274 if (reg == NULL || loc == NULL)
+6 -6
drivers/macintosh/windfarm_smu_sensors.c
··· 198 198 static struct smu_ad_sensor *smu_ads_create(struct device_node *node) 199 199 { 200 200 struct smu_ad_sensor *ads; 201 - char *c, *l; 202 - u32 *v; 201 + const char *c, *l; 202 + const u32 *v; 203 203 204 204 ads = kmalloc(sizeof(struct smu_ad_sensor), GFP_KERNEL); 205 205 if (ads == NULL) 206 206 return NULL; 207 - c = (char *)get_property(node, "device_type", NULL); 208 - l = (char *)get_property(node, "location", NULL); 207 + c = get_property(node, "device_type", NULL); 208 + l = get_property(node, "location", NULL); 209 209 if (c == NULL || l == NULL) 210 210 goto fail; 211 211 ··· 255 255 } else 256 256 goto fail; 257 257 258 - v = (u32 *)get_property(node, "reg", NULL); 258 + v = get_property(node, "reg", NULL); 259 259 if (v == NULL) 260 260 goto fail; 261 261 ads->reg = *v; ··· 382 382 383 383 static void smu_fetch_param_partitions(void) 384 384 { 385 - struct smu_sdbp_header *hdr; 385 + const struct smu_sdbp_header *hdr; 386 386 387 387 /* Get CPU voltage/current/power calibration data */ 388 388 hdr = smu_get_sdb_partition(SMU_SDB_CPUVCP_ID, NULL);
+5 -4
drivers/serial/pmac_zilog.c
··· 1400 1400 static int __init pmz_init_port(struct uart_pmac_port *uap) 1401 1401 { 1402 1402 struct device_node *np = uap->node; 1403 - char *conn; 1404 - struct slot_names_prop { 1403 + const char *conn; 1404 + const struct slot_names_prop { 1405 1405 int count; 1406 1406 char name[1]; 1407 1407 } *slots; ··· 1458 1458 uap->flags |= PMACZILOG_FLAG_IS_IRDA; 1459 1459 uap->port_type = PMAC_SCC_ASYNC; 1460 1460 /* 1999 Powerbook G3 has slot-names property instead */ 1461 - slots = (struct slot_names_prop *)get_property(np, "slot-names", &len); 1461 + slots = get_property(np, "slot-names", &len); 1462 1462 if (slots && slots->count > 0) { 1463 1463 if (strcmp(slots->name, "IrDA") == 0) 1464 1464 uap->flags |= PMACZILOG_FLAG_IS_IRDA; ··· 1470 1470 if (ZS_IS_INTMODEM(uap)) { 1471 1471 struct device_node* i2c_modem = find_devices("i2c-modem"); 1472 1472 if (i2c_modem) { 1473 - char* mid = get_property(i2c_modem, "modem-id", NULL); 1473 + const char* mid = 1474 + get_property(i2c_modem, "modem-id", NULL); 1474 1475 if (mid) switch(*mid) { 1475 1476 case 0x04 : 1476 1477 case 0x05 :
+1 -1
include/asm-powerpc/smu.h
··· 517 517 * This returns the pointer to an SMU "sdb" partition data or NULL 518 518 * if not found. The data format is described below 519 519 */ 520 - extern struct smu_sdbp_header *smu_get_sdb_partition(int id, 520 + extern const struct smu_sdbp_header *smu_get_sdb_partition(int id, 521 521 unsigned int *size); 522 522 523 523 /* Get "sdb" partition data from an SMU satellite */