summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/wl12xx/boot.c
diff options
context:
space:
mode:
authorMircea Gherzan <mgherzan@gmail.com>2012-03-17 21:41:53 +0400
committerLuciano Coelho <coelho@ti.com>2012-04-10 13:14:58 +0400
commit690142e9882679fac4993bbb01582dd1b9440605 (patch)
tree3ad1a00af4fa9c26a8cd526c473d1dee45f1b7a4 /drivers/net/wireless/wl12xx/boot.c
parentc56dbd57f3627203f2384ae1a5e71cf41904370e (diff)
downloadlinux-690142e9882679fac4993bbb01582dd1b9440605.tar.xz
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/boot.c')
-rw-r--r--drivers/net/wireless/wl12xx/boot.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/boot.c b/drivers/net/wireless/wl12xx/boot.c
index 954101d03f06..88d60c40b7e3 100644
--- a/drivers/net/wireless/wl12xx/boot.c
+++ b/drivers/net/wireless/wl12xx/boot.c
@@ -83,14 +83,22 @@ static void wl1271_parse_fw_ver(struct wl1271 *wl)
static void wl1271_boot_fw_version(struct wl1271 *wl)
{
- struct wl1271_static_data static_data;
+ struct wl1271_static_data *static_data;
- wl1271_read(wl, wl->cmd_box_addr, &static_data, sizeof(static_data),
+ static_data = kmalloc(sizeof(*static_data), GFP_DMA);
+ if (!static_data) {
+ __WARN();
+ return;
+ }
+
+ wl1271_read(wl, wl->cmd_box_addr, static_data, sizeof(*static_data),
false);
- strncpy(wl->chip.fw_ver_str, static_data.fw_version,
+ strncpy(wl->chip.fw_ver_str, static_data->fw_version,
sizeof(wl->chip.fw_ver_str));
+ kfree(static_data);
+
/* make sure the string is NULL-terminated */
wl->chip.fw_ver_str[sizeof(wl->chip.fw_ver_str) - 1] = '\0';