diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2006-07-12 01:35:54 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-07-31 01:55:04 -0400 |
commit | a7f67bdf2c9f24509b8e81e0f35573b611987c80 (patch) | |
tree | 201662dd6504418ef3c84cfe1f280153a4d8cb29 /arch/powerpc/kernel/prom.c | |
parent | 4288b92b9644fdb4c6168273873fe08f32090d7a (diff) |
[POWERPC] 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.
powerpc core changes.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
-rw-r--r-- | arch/powerpc/kernel/prom.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index a1787ffb6319..2a3d84a39cb5 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -942,11 +942,11 @@ void __init early_init_devtree(void *params) | |||
942 | int | 942 | int |
943 | prom_n_addr_cells(struct device_node* np) | 943 | prom_n_addr_cells(struct device_node* np) |
944 | { | 944 | { |
945 | int* ip; | 945 | const int *ip; |
946 | do { | 946 | do { |
947 | if (np->parent) | 947 | if (np->parent) |
948 | np = np->parent; | 948 | np = np->parent; |
949 | ip = (int *) get_property(np, "#address-cells", NULL); | 949 | ip = get_property(np, "#address-cells", NULL); |
950 | if (ip != NULL) | 950 | if (ip != NULL) |
951 | return *ip; | 951 | return *ip; |
952 | } while (np->parent); | 952 | } while (np->parent); |
@@ -958,11 +958,11 @@ EXPORT_SYMBOL(prom_n_addr_cells); | |||
958 | int | 958 | int |
959 | prom_n_size_cells(struct device_node* np) | 959 | prom_n_size_cells(struct device_node* np) |
960 | { | 960 | { |
961 | int* ip; | 961 | const int* ip; |
962 | do { | 962 | do { |
963 | if (np->parent) | 963 | if (np->parent) |
964 | np = np->parent; | 964 | np = np->parent; |
965 | ip = (int *) get_property(np, "#size-cells", NULL); | 965 | ip = get_property(np, "#size-cells", NULL); |
966 | if (ip != NULL) | 966 | if (ip != NULL) |
967 | return *ip; | 967 | return *ip; |
968 | } while (np->parent); | 968 | } while (np->parent); |
@@ -1034,7 +1034,7 @@ int device_is_compatible(struct device_node *device, const char *compat) | |||
1034 | const char* cp; | 1034 | const char* cp; |
1035 | int cplen, l; | 1035 | int cplen, l; |
1036 | 1036 | ||
1037 | cp = (char *) get_property(device, "compatible", &cplen); | 1037 | cp = get_property(device, "compatible", &cplen); |
1038 | if (cp == NULL) | 1038 | if (cp == NULL) |
1039 | return 0; | 1039 | return 0; |
1040 | while (cplen > 0) { | 1040 | while (cplen > 0) { |
@@ -1449,7 +1449,7 @@ static int of_finish_dynamic_node(struct device_node *node) | |||
1449 | { | 1449 | { |
1450 | struct device_node *parent = of_get_parent(node); | 1450 | struct device_node *parent = of_get_parent(node); |
1451 | int err = 0; | 1451 | int err = 0; |
1452 | phandle *ibm_phandle; | 1452 | const phandle *ibm_phandle; |
1453 | 1453 | ||
1454 | node->name = get_property(node, "name", NULL); | 1454 | node->name = get_property(node, "name", NULL); |
1455 | node->type = get_property(node, "device_type", NULL); | 1455 | node->type = get_property(node, "device_type", NULL); |
@@ -1466,8 +1466,7 @@ static int of_finish_dynamic_node(struct device_node *node) | |||
1466 | return -ENODEV; | 1466 | return -ENODEV; |
1467 | 1467 | ||
1468 | /* fix up new node's linux_phandle field */ | 1468 | /* fix up new node's linux_phandle field */ |
1469 | if ((ibm_phandle = (unsigned int *)get_property(node, | 1469 | if ((ibm_phandle = get_property(node, "ibm,phandle", NULL))) |
1470 | "ibm,phandle", NULL))) | ||
1471 | node->linux_phandle = *ibm_phandle; | 1470 | node->linux_phandle = *ibm_phandle; |
1472 | 1471 | ||
1473 | out: | 1472 | out: |
@@ -1658,16 +1657,16 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread) | |||
1658 | hardid = get_hard_smp_processor_id(cpu); | 1657 | hardid = get_hard_smp_processor_id(cpu); |
1659 | 1658 | ||
1660 | for_each_node_by_type(np, "cpu") { | 1659 | for_each_node_by_type(np, "cpu") { |
1661 | u32 *intserv; | 1660 | const u32 *intserv; |
1662 | unsigned int plen, t; | 1661 | unsigned int plen, t; |
1663 | 1662 | ||
1664 | /* Check for ibm,ppc-interrupt-server#s. If it doesn't exist | 1663 | /* Check for ibm,ppc-interrupt-server#s. If it doesn't exist |
1665 | * fallback to "reg" property and assume no threads | 1664 | * fallback to "reg" property and assume no threads |
1666 | */ | 1665 | */ |
1667 | intserv = (u32 *)get_property(np, "ibm,ppc-interrupt-server#s", | 1666 | intserv = get_property(np, "ibm,ppc-interrupt-server#s", |
1668 | &plen); | 1667 | &plen); |
1669 | if (intserv == NULL) { | 1668 | if (intserv == NULL) { |
1670 | u32 *reg = (u32 *)get_property(np, "reg", NULL); | 1669 | const u32 *reg = get_property(np, "reg", NULL); |
1671 | if (reg == NULL) | 1670 | if (reg == NULL) |
1672 | continue; | 1671 | continue; |
1673 | if (*reg == hardid) { | 1672 | if (*reg == hardid) { |