diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2009-12-15 23:26:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-23 17:13:32 -0500 |
commit | fe45332ed289d91e57eca11bfd1ca75d6e420ab4 (patch) | |
tree | 949e268337d8f219eda5b3dcb0a441ee500d351a /drivers/misc/iwmc3200top/main.c | |
parent | 0df828f670b1fd8c469f3d60472ddca0d0f51fcf (diff) |
iwmc3200top: simplify imwct_tx
1. remove address argument since we use same address IWMC_SDIO_DATA_ADDR in
all cases
2. add __iwmct_tx - non locking tx function for already locked contexts
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/misc/iwmc3200top/main.c')
-rw-r--r-- | drivers/misc/iwmc3200top/main.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/drivers/misc/iwmc3200top/main.c b/drivers/misc/iwmc3200top/main.c index 38627949ff54..dd0a3913bf6d 100644 --- a/drivers/misc/iwmc3200top/main.c +++ b/drivers/misc/iwmc3200top/main.c | |||
@@ -49,6 +49,20 @@ MODULE_LICENSE("GPL"); | |||
49 | MODULE_AUTHOR(DRIVER_COPYRIGHT); | 49 | MODULE_AUTHOR(DRIVER_COPYRIGHT); |
50 | MODULE_FIRMWARE(FW_NAME(FW_API_VER)); | 50 | MODULE_FIRMWARE(FW_NAME(FW_API_VER)); |
51 | 51 | ||
52 | |||
53 | static inline int __iwmct_tx(struct iwmct_priv *priv, void *src, int count) | ||
54 | { | ||
55 | return sdio_memcpy_toio(priv->func, IWMC_SDIO_DATA_ADDR, src, count); | ||
56 | |||
57 | } | ||
58 | int iwmct_tx(struct iwmct_priv *priv, void *src, int count) | ||
59 | { | ||
60 | int ret; | ||
61 | sdio_claim_host(priv->func); | ||
62 | ret = __iwmct_tx(priv, src, count); | ||
63 | sdio_release_host(priv->func); | ||
64 | return ret; | ||
65 | } | ||
52 | /* | 66 | /* |
53 | * This workers main task is to wait for OP_OPR_ALIVE | 67 | * This workers main task is to wait for OP_OPR_ALIVE |
54 | * from TOP FW until ALIVE_MSG_TIMOUT timeout is elapsed. | 68 | * from TOP FW until ALIVE_MSG_TIMOUT timeout is elapsed. |
@@ -158,27 +172,12 @@ int iwmct_send_hcmd(struct iwmct_priv *priv, u8 *cmd, u16 len) | |||
158 | } | 172 | } |
159 | 173 | ||
160 | memcpy(buf, cmd, len); | 174 | memcpy(buf, cmd, len); |
161 | 175 | ret = iwmct_tx(priv, buf, FW_HCMD_BLOCK_SIZE); | |
162 | sdio_claim_host(priv->func); | ||
163 | ret = sdio_memcpy_toio(priv->func, IWMC_SDIO_DATA_ADDR, buf, | ||
164 | FW_HCMD_BLOCK_SIZE); | ||
165 | sdio_release_host(priv->func); | ||
166 | 176 | ||
167 | kfree(buf); | 177 | kfree(buf); |
168 | return ret; | 178 | return ret; |
169 | } | 179 | } |
170 | 180 | ||
171 | int iwmct_tx(struct iwmct_priv *priv, unsigned int addr, | ||
172 | void *src, int count) | ||
173 | { | ||
174 | int ret; | ||
175 | |||
176 | sdio_claim_host(priv->func); | ||
177 | ret = sdio_memcpy_toio(priv->func, addr, src, count); | ||
178 | sdio_release_host(priv->func); | ||
179 | |||
180 | return ret; | ||
181 | } | ||
182 | 181 | ||
183 | static void iwmct_irq_read_worker(struct work_struct *ws) | 182 | static void iwmct_irq_read_worker(struct work_struct *ws) |
184 | { | 183 | { |
@@ -273,8 +272,7 @@ static void iwmct_irq_read_worker(struct work_struct *ws) | |||
273 | 272 | ||
274 | if (barker & BARKER_DNLOAD_SYNC_MSK) { | 273 | if (barker & BARKER_DNLOAD_SYNC_MSK) { |
275 | /* Send the same barker back */ | 274 | /* Send the same barker back */ |
276 | ret = sdio_memcpy_toio(priv->func, IWMC_SDIO_DATA_ADDR, | 275 | ret = __iwmct_tx(priv, buf, iosize); |
277 | buf, iosize); | ||
278 | if (ret) { | 276 | if (ret) { |
279 | LOG_ERROR(priv, IRQ, | 277 | LOG_ERROR(priv, IRQ, |
280 | "error %d echoing barker\n", ret); | 278 | "error %d echoing barker\n", ret); |