diff options
Diffstat (limited to 'arch/powerpc/boot/flatdevtree_misc.c')
-rw-r--r-- | arch/powerpc/boot/flatdevtree_misc.c | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/arch/powerpc/boot/flatdevtree_misc.c b/arch/powerpc/boot/flatdevtree_misc.c index 04da38fa477f..4341e6558c1a 100644 --- a/arch/powerpc/boot/flatdevtree_misc.c +++ b/arch/powerpc/boot/flatdevtree_misc.c | |||
@@ -16,24 +16,43 @@ | |||
16 | 16 | ||
17 | static struct ft_cxt cxt; | 17 | static struct ft_cxt cxt; |
18 | 18 | ||
19 | static void *ft_finddevice(const char *name) | 19 | static void *fdtm_finddevice(const char *name) |
20 | { | 20 | { |
21 | return ft_find_device(&cxt, name); | 21 | return ft_find_device(&cxt, name); |
22 | } | 22 | } |
23 | 23 | ||
24 | static int ft_getprop(const void *phandle, const char *propname, void *buf, | 24 | static int fdtm_getprop(const void *phandle, const char *propname, |
25 | const int buflen) | 25 | void *buf, const int buflen) |
26 | { | 26 | { |
27 | return ft_get_prop(&cxt, phandle, propname, buf, buflen); | 27 | return ft_get_prop(&cxt, phandle, propname, buf, buflen); |
28 | } | 28 | } |
29 | 29 | ||
30 | static int ft_setprop(const void *phandle, const char *propname, | 30 | static int fdtm_setprop(const void *phandle, const char *propname, |
31 | const void *buf, const int buflen) | 31 | const void *buf, const int buflen) |
32 | { | 32 | { |
33 | return ft_set_prop(&cxt, phandle, propname, buf, buflen); | 33 | return ft_set_prop(&cxt, phandle, propname, buf, buflen); |
34 | } | 34 | } |
35 | 35 | ||
36 | static unsigned long ft_finalize(void) | 36 | static void *fdtm_get_parent(const void *phandle) |
37 | { | ||
38 | return ft_get_parent(&cxt, phandle); | ||
39 | } | ||
40 | |||
41 | static void *fdtm_create_node(const void *phandle, const char *name) | ||
42 | { | ||
43 | return ft_create_node(&cxt, phandle, name); | ||
44 | } | ||
45 | |||
46 | static void *fdtm_find_node_by_prop_value(const void *prev, | ||
47 | const char *propname, | ||
48 | const char *propval, | ||
49 | int proplen) | ||
50 | { | ||
51 | return ft_find_node_by_prop_value(&cxt, prev, propname, | ||
52 | propval, proplen); | ||
53 | } | ||
54 | |||
55 | static unsigned long fdtm_finalize(void) | ||
37 | { | 56 | { |
38 | ft_end_tree(&cxt); | 57 | ft_end_tree(&cxt); |
39 | return (unsigned long)cxt.bph; | 58 | return (unsigned long)cxt.bph; |
@@ -41,10 +60,13 @@ static unsigned long ft_finalize(void) | |||
41 | 60 | ||
42 | int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device) | 61 | int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device) |
43 | { | 62 | { |
44 | dt_ops.finddevice = ft_finddevice; | 63 | dt_ops.finddevice = fdtm_finddevice; |
45 | dt_ops.getprop = ft_getprop; | 64 | dt_ops.getprop = fdtm_getprop; |
46 | dt_ops.setprop = ft_setprop; | 65 | dt_ops.setprop = fdtm_setprop; |
47 | dt_ops.finalize = ft_finalize; | 66 | dt_ops.get_parent = fdtm_get_parent; |
67 | dt_ops.create_node = fdtm_create_node; | ||
68 | dt_ops.find_node_by_prop_value = fdtm_find_node_by_prop_value; | ||
69 | dt_ops.finalize = fdtm_finalize; | ||
48 | 70 | ||
49 | return ft_open(&cxt, dt_blob, max_size, max_find_device, | 71 | return ft_open(&cxt, dt_blob, max_size, max_find_device, |
50 | platform_ops.realloc); | 72 | platform_ops.realloc); |