diff options
Diffstat (limited to 'arch/m32r/kernel/io_oaks32r.c')
-rw-r--r-- | arch/m32r/kernel/io_oaks32r.c | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/arch/m32r/kernel/io_oaks32r.c b/arch/m32r/kernel/io_oaks32r.c index 286964794d51..9997dddd24d7 100644 --- a/arch/m32r/kernel/io_oaks32r.c +++ b/arch/m32r/kernel/io_oaks32r.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Typical I/O routines for OAKS32R board. | 4 | * Typical I/O routines for OAKS32R board. |
5 | * | 5 | * |
6 | * Copyright (c) 2001-2004 Hiroyuki Kondo, Hirokazu Takata, | 6 | * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata, |
7 | * Hitoshi Yamamoto, Mamoru Sakugawa | 7 | * Hitoshi Yamamoto, Mamoru Sakugawa |
8 | */ | 8 | */ |
9 | 9 | ||
@@ -90,35 +90,21 @@ unsigned long _inl(unsigned long port) | |||
90 | 90 | ||
91 | unsigned char _inb_p(unsigned long port) | 91 | unsigned char _inb_p(unsigned long port) |
92 | { | 92 | { |
93 | unsigned char v; | 93 | unsigned char v = _inb(port); |
94 | |||
95 | if (port >= 0x300 && port < 0x320) | ||
96 | v = _ne_inb(PORT2ADDR_NE(port)); | ||
97 | else | ||
98 | v = *(volatile unsigned char *)PORT2ADDR(port); | ||
99 | |||
100 | delay(); | 94 | delay(); |
101 | return (v); | 95 | return (v); |
102 | } | 96 | } |
103 | 97 | ||
104 | unsigned short _inw_p(unsigned long port) | 98 | unsigned short _inw_p(unsigned long port) |
105 | { | 99 | { |
106 | unsigned short v; | 100 | unsigned short v = _inw(port); |
107 | |||
108 | if (port >= 0x300 && port < 0x320) | ||
109 | v = _ne_inw(PORT2ADDR_NE(port)); | ||
110 | else | ||
111 | v = *(volatile unsigned short *)PORT2ADDR(port); | ||
112 | |||
113 | delay(); | 101 | delay(); |
114 | return (v); | 102 | return (v); |
115 | } | 103 | } |
116 | 104 | ||
117 | unsigned long _inl_p(unsigned long port) | 105 | unsigned long _inl_p(unsigned long port) |
118 | { | 106 | { |
119 | unsigned long v; | 107 | unsigned long v = _inl(port); |
120 | |||
121 | v = *(volatile unsigned long *)PORT2ADDR(port); | ||
122 | delay(); | 108 | delay(); |
123 | return (v); | 109 | return (v); |
124 | } | 110 | } |
@@ -146,27 +132,19 @@ void _outl(unsigned long l, unsigned long port) | |||
146 | 132 | ||
147 | void _outb_p(unsigned char b, unsigned long port) | 133 | void _outb_p(unsigned char b, unsigned long port) |
148 | { | 134 | { |
149 | if (port >= 0x300 && port < 0x320) | 135 | _outb(b, port); |
150 | _ne_outb(b, PORT2ADDR_NE(port)); | ||
151 | else | ||
152 | *(volatile unsigned char *)PORT2ADDR(port) = b; | ||
153 | |||
154 | delay(); | 136 | delay(); |
155 | } | 137 | } |
156 | 138 | ||
157 | void _outw_p(unsigned short w, unsigned long port) | 139 | void _outw_p(unsigned short w, unsigned long port) |
158 | { | 140 | { |
159 | if (port >= 0x300 && port < 0x320) | 141 | _outw(w, port); |
160 | _ne_outw(w, PORT2ADDR_NE(port)); | ||
161 | else | ||
162 | *(volatile unsigned short *)PORT2ADDR(port) = w; | ||
163 | |||
164 | delay(); | 142 | delay(); |
165 | } | 143 | } |
166 | 144 | ||
167 | void _outl_p(unsigned long l, unsigned long port) | 145 | void _outl_p(unsigned long l, unsigned long port) |
168 | { | 146 | { |
169 | *(volatile unsigned long *)PORT2ADDR(port) = l; | 147 | _outl(l, port); |
170 | delay(); | 148 | delay(); |
171 | } | 149 | } |
172 | 150 | ||