diff options
author | Thomas Chou <thomas@wytron.com.tw> | 2009-10-07 10:16:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-19 00:24:14 -0400 |
commit | 16dd18b0837dee46f1a6b0c01830c5f2b7187266 (patch) | |
tree | 81b5c96ba5f0aacab71237fdc8a7724d6be4c9a9 /drivers/net/ethoc.c | |
parent | f6965582ac9b87d875aac8e23afdb03fe35ee33d (diff) |
ethoc: inline regs access
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethoc.c')
-rw-r--r-- | drivers/net/ethoc.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c index 1d338c6f5314..88a1c5223069 100644 --- a/drivers/net/ethoc.c +++ b/drivers/net/ethoc.c | |||
@@ -222,24 +222,25 @@ struct ethoc_bd { | |||
222 | u32 addr; | 222 | u32 addr; |
223 | }; | 223 | }; |
224 | 224 | ||
225 | static u32 ethoc_read(struct ethoc *dev, loff_t offset) | 225 | static inline u32 ethoc_read(struct ethoc *dev, loff_t offset) |
226 | { | 226 | { |
227 | return ioread32(dev->iobase + offset); | 227 | return ioread32(dev->iobase + offset); |
228 | } | 228 | } |
229 | 229 | ||
230 | static void ethoc_write(struct ethoc *dev, loff_t offset, u32 data) | 230 | static inline void ethoc_write(struct ethoc *dev, loff_t offset, u32 data) |
231 | { | 231 | { |
232 | iowrite32(data, dev->iobase + offset); | 232 | iowrite32(data, dev->iobase + offset); |
233 | } | 233 | } |
234 | 234 | ||
235 | static void ethoc_read_bd(struct ethoc *dev, int index, struct ethoc_bd *bd) | 235 | static inline void ethoc_read_bd(struct ethoc *dev, int index, |
236 | struct ethoc_bd *bd) | ||
236 | { | 237 | { |
237 | loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); | 238 | loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); |
238 | bd->stat = ethoc_read(dev, offset + 0); | 239 | bd->stat = ethoc_read(dev, offset + 0); |
239 | bd->addr = ethoc_read(dev, offset + 4); | 240 | bd->addr = ethoc_read(dev, offset + 4); |
240 | } | 241 | } |
241 | 242 | ||
242 | static void ethoc_write_bd(struct ethoc *dev, int index, | 243 | static inline void ethoc_write_bd(struct ethoc *dev, int index, |
243 | const struct ethoc_bd *bd) | 244 | const struct ethoc_bd *bd) |
244 | { | 245 | { |
245 | loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); | 246 | loff_t offset = ETHOC_BD_BASE + (index * sizeof(struct ethoc_bd)); |
@@ -247,33 +248,33 @@ static void ethoc_write_bd(struct ethoc *dev, int index, | |||
247 | ethoc_write(dev, offset + 4, bd->addr); | 248 | ethoc_write(dev, offset + 4, bd->addr); |
248 | } | 249 | } |
249 | 250 | ||
250 | static void ethoc_enable_irq(struct ethoc *dev, u32 mask) | 251 | static inline void ethoc_enable_irq(struct ethoc *dev, u32 mask) |
251 | { | 252 | { |
252 | u32 imask = ethoc_read(dev, INT_MASK); | 253 | u32 imask = ethoc_read(dev, INT_MASK); |
253 | imask |= mask; | 254 | imask |= mask; |
254 | ethoc_write(dev, INT_MASK, imask); | 255 | ethoc_write(dev, INT_MASK, imask); |
255 | } | 256 | } |
256 | 257 | ||
257 | static void ethoc_disable_irq(struct ethoc *dev, u32 mask) | 258 | static inline void ethoc_disable_irq(struct ethoc *dev, u32 mask) |
258 | { | 259 | { |
259 | u32 imask = ethoc_read(dev, INT_MASK); | 260 | u32 imask = ethoc_read(dev, INT_MASK); |
260 | imask &= ~mask; | 261 | imask &= ~mask; |
261 | ethoc_write(dev, INT_MASK, imask); | 262 | ethoc_write(dev, INT_MASK, imask); |
262 | } | 263 | } |
263 | 264 | ||
264 | static void ethoc_ack_irq(struct ethoc *dev, u32 mask) | 265 | static inline void ethoc_ack_irq(struct ethoc *dev, u32 mask) |
265 | { | 266 | { |
266 | ethoc_write(dev, INT_SOURCE, mask); | 267 | ethoc_write(dev, INT_SOURCE, mask); |
267 | } | 268 | } |
268 | 269 | ||
269 | static void ethoc_enable_rx_and_tx(struct ethoc *dev) | 270 | static inline void ethoc_enable_rx_and_tx(struct ethoc *dev) |
270 | { | 271 | { |
271 | u32 mode = ethoc_read(dev, MODER); | 272 | u32 mode = ethoc_read(dev, MODER); |
272 | mode |= MODER_RXEN | MODER_TXEN; | 273 | mode |= MODER_RXEN | MODER_TXEN; |
273 | ethoc_write(dev, MODER, mode); | 274 | ethoc_write(dev, MODER, mode); |
274 | } | 275 | } |
275 | 276 | ||
276 | static void ethoc_disable_rx_and_tx(struct ethoc *dev) | 277 | static inline void ethoc_disable_rx_and_tx(struct ethoc *dev) |
277 | { | 278 | { |
278 | u32 mode = ethoc_read(dev, MODER); | 279 | u32 mode = ethoc_read(dev, MODER); |
279 | mode &= ~(MODER_RXEN | MODER_TXEN); | 280 | mode &= ~(MODER_RXEN | MODER_TXEN); |