diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-05-01 02:26:07 -0400 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2007-07-19 23:28:41 -0400 |
commit | 97e873e5c8ad8711ce4cca080cff4eb5d21b3aeb (patch) | |
tree | 7736415a2086522a083392f9ead34dac76c9560c /arch/powerpc/kernel | |
parent | 76c1ce7870fd9b05431da1bbd47fdafcc029a25b (diff) |
Start split out of common open firmware code
This creates drivers/of/base.c (depending on CONFIG_OF) and puts
the first trivially common bits from the prom.c files into it.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Paul Mackerras <paulus@samba.org>
Acked-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/prom.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 37ff99bd98b4..6c9419a4d70a 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -1056,35 +1056,6 @@ void __init early_init_devtree(void *params) | |||
1056 | DBG(" <- early_init_devtree()\n"); | 1056 | DBG(" <- early_init_devtree()\n"); |
1057 | } | 1057 | } |
1058 | 1058 | ||
1059 | int of_n_addr_cells(struct device_node* np) | ||
1060 | { | ||
1061 | const int *ip; | ||
1062 | do { | ||
1063 | if (np->parent) | ||
1064 | np = np->parent; | ||
1065 | ip = of_get_property(np, "#address-cells", NULL); | ||
1066 | if (ip != NULL) | ||
1067 | return *ip; | ||
1068 | } while (np->parent); | ||
1069 | /* No #address-cells property for the root node, default to 1 */ | ||
1070 | return 1; | ||
1071 | } | ||
1072 | EXPORT_SYMBOL(of_n_addr_cells); | ||
1073 | |||
1074 | int of_n_size_cells(struct device_node* np) | ||
1075 | { | ||
1076 | const int* ip; | ||
1077 | do { | ||
1078 | if (np->parent) | ||
1079 | np = np->parent; | ||
1080 | ip = of_get_property(np, "#size-cells", NULL); | ||
1081 | if (ip != NULL) | ||
1082 | return *ip; | ||
1083 | } while (np->parent); | ||
1084 | /* No #size-cells property for the root node, default to 1 */ | ||
1085 | return 1; | ||
1086 | } | ||
1087 | EXPORT_SYMBOL(of_n_size_cells); | ||
1088 | 1059 | ||
1089 | /** Checks if the given "compat" string matches one of the strings in | 1060 | /** Checks if the given "compat" string matches one of the strings in |
1090 | * the device's "compatible" property | 1061 | * the device's "compatible" property |
@@ -1563,18 +1534,6 @@ struct property *of_find_property(const struct device_node *np, | |||
1563 | EXPORT_SYMBOL(of_find_property); | 1534 | EXPORT_SYMBOL(of_find_property); |
1564 | 1535 | ||
1565 | /* | 1536 | /* |
1566 | * Find a property with a given name for a given node | ||
1567 | * and return the value. | ||
1568 | */ | ||
1569 | const void *of_get_property(const struct device_node *np, const char *name, | ||
1570 | int *lenp) | ||
1571 | { | ||
1572 | struct property *pp = of_find_property(np,name,lenp); | ||
1573 | return pp ? pp->value : NULL; | ||
1574 | } | ||
1575 | EXPORT_SYMBOL(of_get_property); | ||
1576 | |||
1577 | /* | ||
1578 | * Add a property to a node | 1537 | * Add a property to a node |
1579 | */ | 1538 | */ |
1580 | int prom_add_property(struct device_node* np, struct property* prop) | 1539 | int prom_add_property(struct device_node* np, struct property* prop) |