staging: wilc1000: remove wilc_exported_buf.c
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Sep 2015 01:44:19 +0000 (18:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 01:24:39 +0000 (18:24 -0700)
The config option, CONFIG_WILC1000_PREALLOCATE_DURING_SYSTEM_BOOT, was
never able to be set, so this file was never being built.  Also, as
WILC_PREALLOC_AT_BOOT was never being set in the build system, remove
all code framed by that symbol.

Cc: Johnny Kim <johnny.kim@atmel.com>
Cc: Rachel Kim <rachel.kim@atmel.com>
Cc: Dean Lee <dean.lee@atmel.com>
Cc: Chris Park <chris.park@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/Makefile
drivers/staging/wilc1000/wilc_exported_buf.c [deleted file]
drivers/staging/wilc1000/wilc_wlan.c

index 6be8a920706a1065534d1d0bca1cc1472618c10e..3b6bc7bbc22969a3230156fa12f11bc53b6eb7e8 100644 (file)
@@ -1,6 +1,4 @@
 obj-$(CONFIG_WILC1000) += wilc1000.o
-obj-$(CONFIG_WILC1000_PREALLOCATE_DURING_SYSTEM_BOOT) += wilc_exported_buf.o
-
 
 ccflags-$(CONFIG_WILC1000_SDIO) += -DWILC_SDIO -DCOMPLEMENT_BOOT
 ccflags-$(CONFIG_WILC1000_HW_OOB_INTR) += -DWILC_SDIO_IRQ_GPIO
@@ -16,9 +14,6 @@ ccflags-y += -I$(src)/ -D__CHECK_ENDIAN__ -DWILC_ASIC_A0 \
                -Wno-unused-function -DUSE_WIRELESS -DWILC_DEBUGFS
 #ccflags-y += -DTCP_ACK_FILTER
 
-ccflags-$(CONFIG_WILC1000_PREALLOCATE_DURING_SYSTEM_BOOT) += -DMEMORY_STATIC \
-                                                               -DWILC_PREALLOC_AT_BOOT
-
 ccflags-$(CONFIG_WILC1000_PREALLOCATE_AT_LOADING_DRIVER) += -DMEMORY_STATIC \
                                                                -DWILC_PREALLOC_AT_INSMOD
 
diff --git a/drivers/staging/wilc1000/wilc_exported_buf.c b/drivers/staging/wilc1000/wilc_exported_buf.c
deleted file mode 100644 (file)
index e617b77..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-
-#define LINUX_RX_SIZE  (96 * 1024)
-#define LINUX_TX_SIZE  (64 * 1024)
-#define WILC1000_FW_SIZE (4 * 1024)
-
-/*
- * Add necessary buffer pointers
- */
-void *exported_g_tx_buf;
-void *exported_g_rx_buf;
-void *exported_g_fw_buf;
-
-void *get_tx_buffer(void)
-{
-       return exported_g_tx_buf;
-}
-EXPORT_SYMBOL(get_tx_buffer);
-
-void *get_rx_buffer(void)
-{
-       return exported_g_rx_buf;
-}
-EXPORT_SYMBOL(get_rx_buffer);
-
-void *get_fw_buffer(void)
-{
-       return exported_g_fw_buf;
-}
-EXPORT_SYMBOL(get_fw_buffer);
-
-static int __init wilc_module_init(void)
-{
-       printk("wilc_module_init\n");
-       /*
-        * alloc necessary memory
-        */
-       exported_g_tx_buf = kmalloc(LINUX_TX_SIZE, GFP_KERNEL);
-       if (!exported_g_tx_buf)
-               return -ENOMEM;
-
-       exported_g_rx_buf = kmalloc(LINUX_RX_SIZE, GFP_KERNEL);
-       if (!exported_g_rx_buf)
-               goto free_g_tx_buf;
-
-       exported_g_fw_buf = kmalloc(WILC1000_FW_SIZE, GFP_KERNEL);
-       if (!exported_g_fw_buf)
-               goto free_g_rx_buf;
-
-       return 0;
-
-free_g_rx_buf:
-       kfree(exported_g_rx_buf);
-       exported_g_rx_buf = NULL;
-
-free_g_tx_buf:
-       kfree(exported_g_tx_buf);
-       exported_g_tx_buf = NULL;
-
-       return -ENOMEM;
-}
-
-static void __exit wilc_module_deinit(void)
-{
-       printk("wilc_module_deinit\n");
-       kfree(exported_g_tx_buf);
-       kfree(exported_g_rx_buf);
-       kfree(exported_g_fw_buf);
-}
-
-MODULE_LICENSE("Dual BSD/GPL");
-MODULE_AUTHOR("Tony Cho");
-MODULE_DESCRIPTION("WILC1xxx Memory Manager");
-pure_initcall(wilc_module_init);
-module_exit(wilc_module_deinit);
index c48fe4ad10adc0bc50377e42a65a20aa56dc3e7d..e0da7b446435752ca2c40a71483b8501f8ec58c2 100644 (file)
@@ -1517,15 +1517,7 @@ static int wilc_wlan_firmware_download(const uint8_t *buffer, uint32_t buffer_si
        blksz = (1ul << 12); /* Bug 4703: 4KB Good enough size for most platforms = PAGE_SIZE. */
        /* Allocate a DMA coherent  buffer. */
 
-#if (defined WILC_PREALLOC_AT_BOOT)
-       {
-               extern void *get_fw_buffer(void);
-               dma_buffer = (uint8_t *)get_fw_buffer();
-               PRINT_D(TX_DBG, "fw_buffer = 0x%x\n", dma_buffer);
-       }
-#else
        dma_buffer = (uint8_t *)g_wlan.os_func.os_malloc(blksz);
-#endif
        if (dma_buffer == NULL) {
                /*EIO   5*/
                ret = -5;
@@ -1575,12 +1567,8 @@ static int wilc_wlan_firmware_download(const uint8_t *buffer, uint32_t buffer_si
 
 _fail_:
 
-#if (defined WILC_PREALLOC_AT_BOOT)
-
-#else
        if (dma_buffer)
                g_wlan.os_func.os_free(dma_buffer);
-#endif
 
 _fail_1:
 
@@ -1829,9 +1817,6 @@ static void wilc_wlan_cleanup(void)
         *      clean up buffer
         **/
 
-#if (defined WILC_PREALLOC_AT_BOOT)
-
-#else
        #ifdef MEMORY_STATIC
        if (p->rx_buffer) {
                p->os_func.os_free(p->rx_buffer);
@@ -1842,7 +1827,6 @@ static void wilc_wlan_cleanup(void)
                p->os_func.os_free(p->tx_buffer);
                p->tx_buffer = NULL;
        }
-#endif
 
        acquire_bus(ACQUIRE_AND_WAKEUP);
 
@@ -2189,21 +2173,8 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup)
        /**
         *      alloc tx, rx buffer
         **/
-#if (defined WILC_PREALLOC_AT_BOOT)
-       extern void *get_tx_buffer(void);
-       extern void *get_rx_buffer(void);
-
-       PRINT_D(TX_DBG, "malloc before, g_wlan.tx_buffer = 0x%x, g_wlan.rx_buffer = 0x%x\n", g_wlan.tx_buffer, g_wlan.rx_buffer);
-#endif
-
-
-
        if (g_wlan.tx_buffer == NULL)
-#if (defined WILC_PREALLOC_AT_BOOT)
-               g_wlan.tx_buffer = (uint8_t *)get_tx_buffer();
-#else
                g_wlan.tx_buffer = (uint8_t *)g_wlan.os_func.os_malloc(g_wlan.tx_buffer_size);
-#endif
        PRINT_D(TX_DBG, "g_wlan.tx_buffer = %p\n", g_wlan.tx_buffer);
 
        if (g_wlan.tx_buffer == NULL) {
@@ -2216,11 +2187,7 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup)
 /* rx_buffer is not used unless we activate USE_MEM STATIC which is not applicable, allocating such memory is useless*/
 #if defined (MEMORY_STATIC)
        if (g_wlan.rx_buffer == NULL)
-  #if (defined WILC_PREALLOC_AT_BOOT)
-               g_wlan.rx_buffer = (uint8_t *)get_rx_buffer();
-  #else
                g_wlan.rx_buffer = (uint8_t *)g_wlan.os_func.os_malloc(g_wlan.rx_buffer_size);
-  #endif
        PRINT_D(TX_DBG, "g_wlan.rx_buffer =%p\n", g_wlan.rx_buffer);
        if (g_wlan.rx_buffer == NULL) {
                /* ENOBUFS      105 */
@@ -2272,9 +2239,6 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup)
 
 _fail_:
 
-#if (defined WILC_PREALLOC_AT_BOOT)
-
-#else
   #ifdef MEMORY_STATIC
        if (g_wlan.rx_buffer) {
                g_wlan.os_func.os_free(g_wlan.rx_buffer);
@@ -2285,7 +2249,6 @@ _fail_:
                g_wlan.os_func.os_free(g_wlan.tx_buffer);
                g_wlan.tx_buffer = NULL;
        }
-#endif
 
 #if defined(PLAT_RK3026_TCHIP) /* AMR : 0422 RK3026 Crash issue */
        if (!g_wilc_initialized)