diff options
Diffstat (limited to 'drivers/of/base.c')
-rw-r--r-- | drivers/of/base.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index 524645ab42a4..873479a21c80 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
@@ -38,7 +38,7 @@ int of_n_addr_cells(struct device_node *np) | |||
38 | np = np->parent; | 38 | np = np->parent; |
39 | ip = of_get_property(np, "#address-cells", NULL); | 39 | ip = of_get_property(np, "#address-cells", NULL); |
40 | if (ip) | 40 | if (ip) |
41 | return *ip; | 41 | return be32_to_cpup(ip); |
42 | } while (np->parent); | 42 | } while (np->parent); |
43 | /* No #address-cells property for the root node */ | 43 | /* No #address-cells property for the root node */ |
44 | return OF_ROOT_NODE_ADDR_CELLS_DEFAULT; | 44 | return OF_ROOT_NODE_ADDR_CELLS_DEFAULT; |
@@ -54,7 +54,7 @@ int of_n_size_cells(struct device_node *np) | |||
54 | np = np->parent; | 54 | np = np->parent; |
55 | ip = of_get_property(np, "#size-cells", NULL); | 55 | ip = of_get_property(np, "#size-cells", NULL); |
56 | if (ip) | 56 | if (ip) |
57 | return *ip; | 57 | return be32_to_cpup(ip); |
58 | } while (np->parent); | 58 | } while (np->parent); |
59 | /* No #size-cells property for the root node */ | 59 | /* No #size-cells property for the root node */ |
60 | return OF_ROOT_NODE_SIZE_CELLS_DEFAULT; | 60 | return OF_ROOT_NODE_SIZE_CELLS_DEFAULT; |
@@ -696,8 +696,8 @@ int of_parse_phandles_with_args(struct device_node *np, const char *list_name, | |||
696 | const void **out_args) | 696 | const void **out_args) |
697 | { | 697 | { |
698 | int ret = -EINVAL; | 698 | int ret = -EINVAL; |
699 | const u32 *list; | 699 | const __be32 *list; |
700 | const u32 *list_end; | 700 | const __be32 *list_end; |
701 | int size; | 701 | int size; |
702 | int cur_index = 0; | 702 | int cur_index = 0; |
703 | struct device_node *node = NULL; | 703 | struct device_node *node = NULL; |
@@ -711,7 +711,7 @@ int of_parse_phandles_with_args(struct device_node *np, const char *list_name, | |||
711 | list_end = list + size / sizeof(*list); | 711 | list_end = list + size / sizeof(*list); |
712 | 712 | ||
713 | while (list < list_end) { | 713 | while (list < list_end) { |
714 | const u32 *cells; | 714 | const __be32 *cells; |
715 | const phandle *phandle; | 715 | const phandle *phandle; |
716 | 716 | ||
717 | phandle = list++; | 717 | phandle = list++; |
@@ -735,7 +735,7 @@ int of_parse_phandles_with_args(struct device_node *np, const char *list_name, | |||
735 | goto err1; | 735 | goto err1; |
736 | } | 736 | } |
737 | 737 | ||
738 | list += *cells; | 738 | list += be32_to_cpup(cells); |
739 | if (list > list_end) { | 739 | if (list > list_end) { |
740 | pr_debug("%s: insufficient arguments length\n", | 740 | pr_debug("%s: insufficient arguments length\n", |
741 | np->full_name); | 741 | np->full_name); |