aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/prom.c24
-rw-r--r--arch/powerpc/platforms/chrp/time.c13
2 files changed, 9 insertions, 28 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index ec6921c54a07..2f7e6ec215f8 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1171,30 +1171,6 @@ int machine_is_compatible(const char *compat)
1171EXPORT_SYMBOL(machine_is_compatible); 1171EXPORT_SYMBOL(machine_is_compatible);
1172 1172
1173/** 1173/**
1174 * Construct and return a list of the device_nodes with a given type
1175 * and compatible property.
1176 */
1177struct device_node *find_compatible_devices(const char *type,
1178 const char *compat)
1179{
1180 struct device_node *head, **prevp, *np;
1181
1182 prevp = &head;
1183 for (np = allnodes; np != 0; np = np->allnext) {
1184 if (type != NULL
1185 && !(np->type != 0 && strcasecmp(np->type, type) == 0))
1186 continue;
1187 if (of_device_is_compatible(np, compat)) {
1188 *prevp = np;
1189 prevp = &np->next;
1190 }
1191 }
1192 *prevp = NULL;
1193 return head;
1194}
1195EXPORT_SYMBOL(find_compatible_devices);
1196
1197/**
1198 * Find the device_node with a given full_name. 1174 * Find the device_node with a given full_name.
1199 */ 1175 */
1200struct device_node *find_path_device(const char *path) 1176struct device_node *find_path_device(const char *path)
diff --git a/arch/powerpc/platforms/chrp/time.c b/arch/powerpc/platforms/chrp/time.c
index 7d7889026936..96d1e4b3c493 100644
--- a/arch/powerpc/platforms/chrp/time.c
+++ b/arch/powerpc/platforms/chrp/time.c
@@ -39,12 +39,17 @@ long __init chrp_time_init(void)
39 struct resource r; 39 struct resource r;
40 int base; 40 int base;
41 41
42 rtcs = find_compatible_devices("rtc", "pnpPNP,b00"); 42 rtcs = of_find_compatible_node(NULL, "rtc", "pnpPNP,b00");
43 if (rtcs == NULL) 43 if (rtcs == NULL)
44 rtcs = find_compatible_devices("rtc", "ds1385-rtc"); 44 rtcs = of_find_compatible_node(NULL, "rtc", "ds1385-rtc");
45 if (rtcs == NULL || of_address_to_resource(rtcs, 0, &r)) 45 if (rtcs == NULL)
46 return 0;
47 if (of_address_to_resource(rtcs, 0, &r)) {
48 of_node_put(rtcs);
46 return 0; 49 return 0;
47 50 }
51 of_node_put(rtcs);
52
48 base = r.start; 53 base = r.start;
49 nvram_as1 = 0; 54 nvram_as1 = 0;
50 nvram_as0 = base; 55 nvram_as0 = base;