diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-20 18:47:35 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-20 18:47:35 -0400 |
| commit | 4becf12de1a4efefd28e057750e35f4ceb32dd1d (patch) | |
| tree | a8f4cab8fd4699e12edc3482d367f1f315cd15fe | |
| parent | 7de2c5b6ae9c99e7b4213c06ed5264c24d943a35 (diff) | |
staging: csr: remove CsrMemAllocDma()
It's just a call to kmalloc(, GFP_KERNEL | GFP_DMA);
But, all memory allocated by kmalloc can be DMAed, and that's not what
GFP_DMA means, so remove that flag, and just call kmalloc(, GFP_KERNEL);
Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com>
Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com>
Cc: Riku Mettälä <riku.mettala@bluegiga.com>
Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/csr/csr_framework_ext.c | 18 | ||||
| -rw-r--r-- | drivers/staging/csr/csr_framework_ext.h | 31 | ||||
| -rw-r--r-- | drivers/staging/csr/csr_wifi_hip_card_sdio.c | 4 | ||||
| -rw-r--r-- | drivers/staging/csr/csr_wifi_hip_card_sdio_intr.c | 2 | ||||
| -rw-r--r-- | drivers/staging/csr/csr_wifi_hip_download.c | 2 |
5 files changed, 4 insertions, 53 deletions
diff --git a/drivers/staging/csr/csr_framework_ext.c b/drivers/staging/csr/csr_framework_ext.c index 771a3692f670..12e7ddf3220a 100644 --- a/drivers/staging/csr/csr_framework_ext.c +++ b/drivers/staging/csr/csr_framework_ext.c | |||
| @@ -146,21 +146,3 @@ void CsrThreadSleep(u16 sleepTimeInMs) | |||
| 146 | schedule_timeout_uninterruptible(t); | 146 | schedule_timeout_uninterruptible(t); |
| 147 | } | 147 | } |
| 148 | EXPORT_SYMBOL_GPL(CsrThreadSleep); | 148 | EXPORT_SYMBOL_GPL(CsrThreadSleep); |
| 149 | |||
| 150 | /*----------------------------------------------------------------------------* | ||
| 151 | * NAME | ||
| 152 | * CsrMemAllocDma | ||
| 153 | * | ||
| 154 | * DESCRIPTION | ||
| 155 | * Allocate DMA capable dynamic memory of a given size. | ||
| 156 | * | ||
| 157 | * RETURNS | ||
| 158 | * Pointer to allocated memory, or NULL in case of failure. | ||
| 159 | * Allocated memory is not initialised. | ||
| 160 | * | ||
| 161 | *----------------------------------------------------------------------------*/ | ||
| 162 | void *CsrMemAllocDma(size_t size) | ||
| 163 | { | ||
| 164 | return kmalloc(size, GFP_KERNEL | GFP_DMA); | ||
| 165 | } | ||
| 166 | EXPORT_SYMBOL_GPL(CsrMemAllocDma); | ||
diff --git a/drivers/staging/csr/csr_framework_ext.h b/drivers/staging/csr/csr_framework_ext.h index 817369da1f97..66973e93a6bc 100644 --- a/drivers/staging/csr/csr_framework_ext.h +++ b/drivers/staging/csr/csr_framework_ext.h | |||
| @@ -241,37 +241,6 @@ CsrResult CsrThreadEqual(CsrThreadHandle *threadHandle1, CsrThreadHandle *thread | |||
| 241 | *----------------------------------------------------------------------------*/ | 241 | *----------------------------------------------------------------------------*/ |
| 242 | void CsrThreadSleep(u16 sleepTimeInMs); | 242 | void CsrThreadSleep(u16 sleepTimeInMs); |
| 243 | 243 | ||
| 244 | #ifndef CSR_PMEM_DEBUG_ENABLE | ||
| 245 | /*----------------------------------------------------------------------------* | ||
| 246 | * NAME | ||
| 247 | * CsrMemAllocDma | ||
| 248 | * | ||
| 249 | * DESCRIPTION | ||
| 250 | * Allocate dynamic memory suitable for DMA transfers. | ||
| 251 | * | ||
| 252 | * RETURNS | ||
| 253 | * Pointer to allocated memory, or NULL in case of failure. | ||
| 254 | * Allocated memory is not initialised. | ||
| 255 | * | ||
| 256 | *----------------------------------------------------------------------------*/ | ||
| 257 | #ifdef CSR_MEM_DEBUG | ||
| 258 | void *CsrMemAllocDmaDebug(size_t size, | ||
| 259 | const char *file, u32 line); | ||
| 260 | #define CsrMemAllocDma(sz) CsrMemAllocDmaDebug((sz), __FILE__, __LINE__) | ||
| 261 | #else | ||
| 262 | void *CsrMemAllocDma(size_t size); | ||
| 263 | #endif | ||
| 264 | |||
| 265 | |||
| 266 | #else | ||
| 267 | |||
| 268 | #include "csr_pmem.h" | ||
| 269 | |||
| 270 | #define CsrMemAllocDma(size) CsrPmemDebugAlloc(size, CSR_PMEM_DEBUG_TYPE_MEM_ALLOC_DMA, __FILE__, __LINE__) | ||
| 271 | |||
| 272 | #endif | ||
| 273 | |||
| 274 | |||
| 275 | #ifdef __cplusplus | 244 | #ifdef __cplusplus |
| 276 | } | 245 | } |
| 277 | #endif | 246 | #endif |
diff --git a/drivers/staging/csr/csr_wifi_hip_card_sdio.c b/drivers/staging/csr/csr_wifi_hip_card_sdio.c index 608a0690d5e0..d4c92814c65d 100644 --- a/drivers/staging/csr/csr_wifi_hip_card_sdio.c +++ b/drivers/staging/csr/csr_wifi_hip_card_sdio.c | |||
| @@ -1630,7 +1630,7 @@ static CsrResult card_allocate_memory_resources(card_t *card) | |||
| 1630 | /* | 1630 | /* |
| 1631 | * Allocate memory for the from-host and to-host signal buffers. | 1631 | * Allocate memory for the from-host and to-host signal buffers. |
| 1632 | */ | 1632 | */ |
| 1633 | card->fh_buffer.buf = CsrMemAllocDma(UNIFI_FH_BUF_SIZE); | 1633 | card->fh_buffer.buf = kmalloc(UNIFI_FH_BUF_SIZE, GFP_KERNEL); |
| 1634 | if (card->fh_buffer.buf == NULL) | 1634 | if (card->fh_buffer.buf == NULL) |
| 1635 | { | 1635 | { |
| 1636 | unifi_error(card->ospriv, "Failed to allocate memory for F-H signals\n"); | 1636 | unifi_error(card->ospriv, "Failed to allocate memory for F-H signals\n"); |
| @@ -1641,7 +1641,7 @@ static CsrResult card_allocate_memory_resources(card_t *card) | |||
| 1641 | card->fh_buffer.ptr = card->fh_buffer.buf; | 1641 | card->fh_buffer.ptr = card->fh_buffer.buf; |
| 1642 | card->fh_buffer.count = 0; | 1642 | card->fh_buffer.count = 0; |
| 1643 | 1643 | ||
| 1644 | card->th_buffer.buf = CsrMemAllocDma(UNIFI_FH_BUF_SIZE); | 1644 | card->th_buffer.buf = kmalloc(UNIFI_FH_BUF_SIZE, GFP_KERNEL); |
| 1645 | if (card->th_buffer.buf == NULL) | 1645 | if (card->th_buffer.buf == NULL) |
| 1646 | { | 1646 | { |
| 1647 | unifi_error(card->ospriv, "Failed to allocate memory for T-H signals\n"); | 1647 | unifi_error(card->ospriv, "Failed to allocate memory for T-H signals\n"); |
diff --git a/drivers/staging/csr/csr_wifi_hip_card_sdio_intr.c b/drivers/staging/csr/csr_wifi_hip_card_sdio_intr.c index 9789579f1fc4..97f645c06818 100644 --- a/drivers/staging/csr/csr_wifi_hip_card_sdio_intr.c +++ b/drivers/staging/csr/csr_wifi_hip_card_sdio_intr.c | |||
| @@ -1758,7 +1758,7 @@ static CsrResult process_bulk_data_command(card_t *card, const u8 *cmdptr, | |||
| 1758 | 1758 | ||
| 1759 | if (len != 0 && (dir == UNIFI_SDIO_WRITE) && (((ptrdiff_t)bdslot->os_data_ptr + offset) & 3)) | 1759 | if (len != 0 && (dir == UNIFI_SDIO_WRITE) && (((ptrdiff_t)bdslot->os_data_ptr + offset) & 3)) |
| 1760 | { | 1760 | { |
| 1761 | host_bulk_data_slot = CsrMemAllocDma(len); | 1761 | host_bulk_data_slot = kmalloc(len, GFP_KERNEL); |
| 1762 | 1762 | ||
| 1763 | if (!host_bulk_data_slot) | 1763 | if (!host_bulk_data_slot) |
| 1764 | { | 1764 | { |
diff --git a/drivers/staging/csr/csr_wifi_hip_download.c b/drivers/staging/csr/csr_wifi_hip_download.c index f0f0ffd89d62..8e4a4608ba5c 100644 --- a/drivers/staging/csr/csr_wifi_hip_download.c +++ b/drivers/staging/csr/csr_wifi_hip_download.c | |||
| @@ -675,7 +675,7 @@ static CsrResult send_ptdl_to_unifi(card_t *card, void *dlpriv, | |||
| 675 | return CSR_WIFI_HIP_RESULT_INVALID_VALUE; | 675 | return CSR_WIFI_HIP_RESULT_INVALID_VALUE; |
| 676 | } | 676 | } |
| 677 | 677 | ||
| 678 | buf = CsrMemAllocDma(buf_size); | 678 | buf = kmalloc(buf_size, GFP_KERNEL); |
| 679 | if (buf == NULL) | 679 | if (buf == NULL) |
| 680 | { | 680 | { |
| 681 | unifi_error(card->ospriv, "Failed to allocate transfer buffer for firmware download\n"); | 681 | unifi_error(card->ospriv, "Failed to allocate transfer buffer for firmware download\n"); |
