Commit 663a31ce authored by Karsten Keil's avatar Karsten Keil Committed by David S. Miller

mISDN: Fix wrong struct name in macro and clarifications

Based on comments from Joe Perches <joe@perches.com>. Thanks.

Fix IOFUNC_MEMIO macro. WriteFiFo##name##_MIO use the wrong struct name,
this was missed because the macro was only called with this name.

Clarify with _func that the defined types are functions.
Add names to the parameters for better understanding the purpose.
Signed-off-by: default avatarKarsten Keil <keil@b1-systems.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 70034918
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
#ifndef _IOHELPER_H #ifndef _IOHELPER_H
#define _IOHELPER_H #define _IOHELPER_H
typedef u8 (read_reg_t)(void *, u8); typedef u8 (read_reg_func)(void *hwp, u8 offset);
typedef void (write_reg_t)(void *, u8, u8); typedef void (write_reg_func)(void *hwp, u8 offset, u8 value);
typedef void (fifo_func_t)(void *, u8, u8 *, int); typedef void (fifo_func)(void *hwp, u8 offset, u8 *datap, int size);
struct _ioport { struct _ioport {
u32 port; u32 port;
...@@ -90,7 +90,7 @@ struct _ioport { ...@@ -90,7 +90,7 @@ struct _ioport {
*dp++ = readb(((typ *)hw->adr) + off);\ *dp++ = readb(((typ *)hw->adr) + off);\
} \ } \
static void WriteFiFo##name##_MIO(void *p, u8 off, u8 *dp, int size) {\ static void WriteFiFo##name##_MIO(void *p, u8 off, u8 *dp, int size) {\
struct inf_hw *hw = p;\ struct hws *hw = p;\
while (size--)\ while (size--)\
writeb(*dp++, ((typ *)hw->adr) + off);\ writeb(*dp++, ((typ *)hw->adr) + off);\
} }
......
...@@ -30,10 +30,10 @@ struct isac_hw { ...@@ -30,10 +30,10 @@ struct isac_hw {
u32 off; /* offset to isac regs */ u32 off; /* offset to isac regs */
char *name; char *name;
spinlock_t *hwlock; /* lock HW acccess */ spinlock_t *hwlock; /* lock HW acccess */
read_reg_t *read_reg; read_reg_func *read_reg;
write_reg_t *write_reg; write_reg_func *write_reg;
fifo_func_t *read_fifo; fifo_func *read_fifo;
fifo_func_t *write_fifo; fifo_func *write_fifo;
int (*monitor)(void *, u32, u8 *, int); int (*monitor)(void *, u32, u8 *, int);
void (*release)(struct isac_hw *); void (*release)(struct isac_hw *);
int (*init)(struct isac_hw *); int (*init)(struct isac_hw *);
...@@ -73,10 +73,10 @@ struct ipac_hw { ...@@ -73,10 +73,10 @@ struct ipac_hw {
spinlock_t *hwlock; /* lock HW acccess */ spinlock_t *hwlock; /* lock HW acccess */
struct module *owner; struct module *owner;
u32 type; u32 type;
read_reg_t *read_reg; read_reg_func *read_reg;
write_reg_t *write_reg; write_reg_func *write_reg;
fifo_func_t *read_fifo; fifo_func *read_fifo;
fifo_func_t *write_fifo; fifo_func *write_fifo;
void (*release)(struct ipac_hw *); void (*release)(struct ipac_hw *);
int (*init)(struct ipac_hw *); int (*init)(struct ipac_hw *);
int (*ctrl)(struct ipac_hw *, u32, u_long); int (*ctrl)(struct ipac_hw *, u32, u_long);
......
...@@ -47,10 +47,10 @@ struct isar_hw { ...@@ -47,10 +47,10 @@ struct isar_hw {
spinlock_t *hwlock; /* lock HW acccess */ spinlock_t *hwlock; /* lock HW acccess */
char *name; char *name;
struct module *owner; struct module *owner;
read_reg_t *read_reg; read_reg_func *read_reg;
write_reg_t *write_reg; write_reg_func *write_reg;
fifo_func_t *read_fifo; fifo_func *read_fifo;
fifo_func_t *write_fifo; fifo_func *write_fifo;
int (*ctrl)(void *, u32, u_long); int (*ctrl)(void *, u32, u_long);
void (*release)(struct isar_hw *); void (*release)(struct isar_hw *);
int (*init)(struct isar_hw *); int (*init)(struct isar_hw *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment