aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2013-08-06 12:01:36 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-08-14 01:33:26 -0400
commit2083f681e3898394dcf5fb3285bb385e21facb9a (patch)
tree738978fefec58c5bf2c4d4e7fec5fbcd3e60fdd4 /arch/powerpc/kernel
parentd213dd5348532051e19150797aeef36099a4ade9 (diff)
powerpc: of_parse_dma_window should take a __be32 *dma_window
We pass dma_window to of_parse_dma_window as a void * and then run through hoops to cast it back to a u32 array. In the process we lose endian annotation. Simplify it by just passing a __be32 * down. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/prom_parse.c17
-rw-r--r--arch/powerpc/kernel/vio.c2
2 files changed, 9 insertions, 10 deletions
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index 4e1331b8eb33..6295e646f78c 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -7,28 +7,27 @@
7#include <linux/of_address.h> 7#include <linux/of_address.h>
8#include <asm/prom.h> 8#include <asm/prom.h>
9 9
10void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop, 10void of_parse_dma_window(struct device_node *dn, const __be32 *dma_window,
11 unsigned long *busno, unsigned long *phys, unsigned long *size) 11 unsigned long *busno, unsigned long *phys,
12 unsigned long *size)
12{ 13{
13 const u32 *dma_window;
14 u32 cells; 14 u32 cells;
15 const unsigned char *prop; 15 const __be32 *prop;
16
17 dma_window = dma_window_prop;
18 16
19 /* busno is always one cell */ 17 /* busno is always one cell */
20 *busno = *(dma_window++); 18 *busno = of_read_number(dma_window, 1);
19 dma_window++;
21 20
22 prop = of_get_property(dn, "ibm,#dma-address-cells", NULL); 21 prop = of_get_property(dn, "ibm,#dma-address-cells", NULL);
23 if (!prop) 22 if (!prop)
24 prop = of_get_property(dn, "#address-cells", NULL); 23 prop = of_get_property(dn, "#address-cells", NULL);
25 24
26 cells = prop ? *(u32 *)prop : of_n_addr_cells(dn); 25 cells = prop ? of_read_number(prop, 1) : of_n_addr_cells(dn);
27 *phys = of_read_number(dma_window, cells); 26 *phys = of_read_number(dma_window, cells);
28 27
29 dma_window += cells; 28 dma_window += cells;
30 29
31 prop = of_get_property(dn, "ibm,#dma-size-cells", NULL); 30 prop = of_get_property(dn, "ibm,#dma-size-cells", NULL);
32 cells = prop ? *(u32 *)prop : of_n_size_cells(dn); 31 cells = prop ? of_read_number(prop, 1) : of_n_size_cells(dn);
33 *size = of_read_number(dma_window, cells); 32 *size = of_read_number(dma_window, cells);
34} 33}
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 536016d792ba..31875a6002b7 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1153,7 +1153,7 @@ EXPORT_SYMBOL(vio_h_cop_sync);
1153 1153
1154static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev) 1154static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
1155{ 1155{
1156 const unsigned char *dma_window; 1156 const __be32 *dma_window;
1157 struct iommu_table *tbl; 1157 struct iommu_table *tbl;
1158 unsigned long offset, size; 1158 unsigned long offset, size;
1159 1159