diff options
Diffstat (limited to 'drivers/net/wireless/cw1200/hwio.c')
-rw-r--r-- | drivers/net/wireless/cw1200/hwio.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/wireless/cw1200/hwio.c b/drivers/net/wireless/cw1200/hwio.c index dad3fb331818..ff230b7aeedd 100644 --- a/drivers/net/wireless/cw1200/hwio.c +++ b/drivers/net/wireless/cw1200/hwio.c | |||
@@ -69,31 +69,33 @@ static int __cw1200_reg_write(struct cw1200_common *priv, u16 addr, | |||
69 | static inline int __cw1200_reg_read_32(struct cw1200_common *priv, | 69 | static inline int __cw1200_reg_read_32(struct cw1200_common *priv, |
70 | u16 addr, u32 *val) | 70 | u16 addr, u32 *val) |
71 | { | 71 | { |
72 | int i = __cw1200_reg_read(priv, addr, val, sizeof(*val), 0); | 72 | __le32 tmp; |
73 | *val = le32_to_cpu(*val); | 73 | int i = __cw1200_reg_read(priv, addr, &tmp, sizeof(tmp), 0); |
74 | *val = le32_to_cpu(tmp); | ||
74 | return i; | 75 | return i; |
75 | } | 76 | } |
76 | 77 | ||
77 | static inline int __cw1200_reg_write_32(struct cw1200_common *priv, | 78 | static inline int __cw1200_reg_write_32(struct cw1200_common *priv, |
78 | u16 addr, u32 val) | 79 | u16 addr, u32 val) |
79 | { | 80 | { |
80 | val = cpu_to_le32(val); | 81 | __le32 tmp = cpu_to_le32(val); |
81 | return __cw1200_reg_write(priv, addr, &val, sizeof(val), 0); | 82 | return __cw1200_reg_write(priv, addr, &tmp, sizeof(tmp), 0); |
82 | } | 83 | } |
83 | 84 | ||
84 | static inline int __cw1200_reg_read_16(struct cw1200_common *priv, | 85 | static inline int __cw1200_reg_read_16(struct cw1200_common *priv, |
85 | u16 addr, u16 *val) | 86 | u16 addr, u16 *val) |
86 | { | 87 | { |
87 | int i = __cw1200_reg_read(priv, addr, val, sizeof(*val), 0); | 88 | __le16 tmp; |
88 | *val = le16_to_cpu(*val); | 89 | int i = __cw1200_reg_read(priv, addr, &tmp, sizeof(tmp), 0); |
90 | *val = le16_to_cpu(tmp); | ||
89 | return i; | 91 | return i; |
90 | } | 92 | } |
91 | 93 | ||
92 | static inline int __cw1200_reg_write_16(struct cw1200_common *priv, | 94 | static inline int __cw1200_reg_write_16(struct cw1200_common *priv, |
93 | u16 addr, u16 val) | 95 | u16 addr, u16 val) |
94 | { | 96 | { |
95 | val = cpu_to_le16(val); | 97 | __le16 tmp = cpu_to_le16(val); |
96 | return __cw1200_reg_write(priv, addr, &val, sizeof(val), 0); | 98 | return __cw1200_reg_write(priv, addr, &tmp, sizeof(tmp), 0); |
97 | } | 99 | } |
98 | 100 | ||
99 | int cw1200_reg_read(struct cw1200_common *priv, u16 addr, void *buf, | 101 | int cw1200_reg_read(struct cw1200_common *priv, u16 addr, void *buf, |