summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/cmd.c
diff options
context:
space:
mode:
authorMircea Gherzan <mgherzan@gmail.com>2012-03-17 18:41:53 +0100
committerLuciano Coelho <coelho@ti.com>2012-04-10 12:14:58 +0300
commit690142e9882679fac4993bbb01582dd1b9440605 (patch)
tree3ad1a00af4fa9c26a8cd526c473d1dee45f1b7a4 /drivers/net/wireless/wl12xx/cmd.c
parentc56dbd57f3627203f2384ae1a5e71cf41904370e (diff)
downloadlinux-690142e9882679fac4993bbb01582dd1b9440605.tar.gz
linux-690142e9882679fac4993bbb01582dd1b9440605.tar.bz2
linux-690142e9882679fac4993bbb01582dd1b9440605.zip
wl12xx: fix DMA-API-related warnings
On the PandaBoard (omap_hsmmc + wl12xx_sdio) with DMA_API_DEBUG: WARNING: at lib/dma-debug.c:930 check_for_stack.part.8+0x7c/0xe0() omap_hsmmc omap_hsmmc.4: DMA-API: device driver maps memory fromstack Signed-off-by: Mircea Gherzan <mgherzan@gmail.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/cmd.c')
-rw-r--r--drivers/net/wireless/wl12xx/cmd.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index 3414fc11e9ba..82cb90a4a99c 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -342,8 +342,12 @@ int wl1271_cmd_ext_radio_parms(struct wl1271 *wl)
*/
static int wl1271_cmd_wait_for_event_or_timeout(struct wl1271 *wl, u32 mask)
{
- u32 events_vector, event;
+ u32 *events_vector;
+ u32 event;
unsigned long timeout;
+ int ret = 0;
+
+ events_vector = kmalloc(sizeof(*events_vector), GFP_DMA);
timeout = jiffies + msecs_to_jiffies(WL1271_EVENT_TIMEOUT);
@@ -351,21 +355,24 @@ static int wl1271_cmd_wait_for_event_or_timeout(struct wl1271 *wl, u32 mask)
if (time_after(jiffies, timeout)) {
wl1271_debug(DEBUG_CMD, "timeout waiting for event %d",
(int)mask);
- return -ETIMEDOUT;
+ ret = -ETIMEDOUT;
+ goto out;
}
msleep(1);
/* read from both event fields */
- wl1271_read(wl, wl->mbox_ptr[0], &events_vector,
- sizeof(events_vector), false);
- event = events_vector & mask;
- wl1271_read(wl, wl->mbox_ptr[1], &events_vector,
- sizeof(events_vector), false);
- event |= events_vector & mask;
+ wl1271_read(wl, wl->mbox_ptr[0], events_vector,
+ sizeof(*events_vector), false);
+ event = *events_vector & mask;
+ wl1271_read(wl, wl->mbox_ptr[1], events_vector,
+ sizeof(*events_vector), false);
+ event |= *events_vector & mask;
} while (!event);
- return 0;
+out:
+ kfree(events_vector);
+ return ret;
}
static int wl1271_cmd_wait_for_event(struct wl1271 *wl, u32 mask)