diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-10-04 03:38:53 -0400 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-11-26 05:09:09 -0500 |
commit | bd9ba8f40ee30edf31cc0845d8838bc43d172ef3 (patch) | |
tree | 4c073ce3a53d7cccbc3ac7335854d424faa2c289 /arch/m68k | |
parent | 986ea58dfb52097999cc388880505fc7a10e4779 (diff) |
zorro/UAPI: Use proper types (endianness/size) in <linux/zorro.h>
Fix member definitions for non-native userspace handling:
- All multi-byte values are big-endian, hence use __be*,
- All pointers are 32-bit pointers under AmigaOS, but unused (except for
cd_BoardAddr) under Linux, hence use __be32.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/amiga/config.c | 9 | ||||
-rw-r--r-- | arch/m68k/amiga/platform.c | 9 |
2 files changed, 11 insertions, 7 deletions
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index acd9c1640cfc..65b5e937ebba 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/keyboard.h> | 28 | #include <linux/keyboard.h> |
29 | 29 | ||
30 | #include <asm/bootinfo.h> | 30 | #include <asm/bootinfo.h> |
31 | #include <asm/byteorder.h> | ||
31 | #include <asm/setup.h> | 32 | #include <asm/setup.h> |
32 | #include <asm/pgtable.h> | 33 | #include <asm/pgtable.h> |
33 | #include <asm/amigahw.h> | 34 | #include <asm/amigahw.h> |
@@ -176,10 +177,10 @@ int __init amiga_parse_bootinfo(const struct bi_record *record) | |||
176 | const struct ConfigDev *cd = (struct ConfigDev *)data; | 177 | const struct ConfigDev *cd = (struct ConfigDev *)data; |
177 | struct zorro_dev_init *dev = &zorro_autocon_init[zorro_num_autocon++]; | 178 | struct zorro_dev_init *dev = &zorro_autocon_init[zorro_num_autocon++]; |
178 | dev->rom = cd->cd_Rom; | 179 | dev->rom = cd->cd_Rom; |
179 | dev->slotaddr = cd->cd_SlotAddr; | 180 | dev->slotaddr = be16_to_cpu(cd->cd_SlotAddr); |
180 | dev->slotsize = cd->cd_SlotSize; | 181 | dev->slotsize = be16_to_cpu(cd->cd_SlotSize); |
181 | dev->boardaddr = (u32)cd->cd_BoardAddr; | 182 | dev->boardaddr = be32_to_cpu(cd->cd_BoardAddr); |
182 | dev->boardsize = cd->cd_BoardSize; | 183 | dev->boardsize = be32_to_cpu(cd->cd_BoardSize); |
183 | } else | 184 | } else |
184 | printk("amiga_parse_bootinfo: too many AutoConfig devices\n"); | 185 | printk("amiga_parse_bootinfo: too many AutoConfig devices\n"); |
185 | #endif /* CONFIG_ZORRO */ | 186 | #endif /* CONFIG_ZORRO */ |
diff --git a/arch/m68k/amiga/platform.c b/arch/m68k/amiga/platform.c index 7847b2b1b5b6..d34029d7b058 100644 --- a/arch/m68k/amiga/platform.c +++ b/arch/m68k/amiga/platform.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <asm/amigahw.h> | 14 | #include <asm/amigahw.h> |
15 | #include <asm/amigayle.h> | 15 | #include <asm/amigayle.h> |
16 | #include <asm/byteorder.h> | ||
16 | 17 | ||
17 | 18 | ||
18 | #ifdef CONFIG_ZORRO | 19 | #ifdef CONFIG_ZORRO |
@@ -66,10 +67,12 @@ static int __init z_dev_present(zorro_id id) | |||
66 | { | 67 | { |
67 | unsigned int i; | 68 | unsigned int i; |
68 | 69 | ||
69 | for (i = 0; i < zorro_num_autocon; i++) | 70 | for (i = 0; i < zorro_num_autocon; i++) { |
70 | if (zorro_autocon_init[i].rom.er_Manufacturer == ZORRO_MANUF(id) && | 71 | const struct ExpansionRom *rom = &zorro_autocon_init[i].rom; |
71 | zorro_autocon_init[i].rom.er_Product == ZORRO_PROD(id)) | 72 | if (be16_to_cpu(rom->er_Manufacturer) == ZORRO_MANUF(id) && |
73 | rom->er_Product == ZORRO_PROD(id)) | ||
72 | return 1; | 74 | return 1; |
75 | } | ||
73 | 76 | ||
74 | return 0; | 77 | return 0; |
75 | } | 78 | } |