staging: wilc1000: assign pointer of g_linux_wlan to sdio device data
authorTony Cho <tony.cho@atmel.com>
Tue, 20 Oct 2015 05:26:56 +0000 (14:26 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Oct 2015 01:14:35 +0000 (18:14 -0700)
This patch assigns wl pointer to sdio device data. The global variable
g_linux_wlan will be removed finally.

Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/linux_wlan.c
drivers/staging/wilc1000/linux_wlan_sdio.c
drivers/staging/wilc1000/wilc_wfi_netdevice.h

index 3cad5b633e16c685ec78d31a5da3f21f5365c780..5701e58f7c4e0b241ef4ea0938e36cee095bd47e 100644 (file)
@@ -1620,9 +1620,8 @@ void wl_wlan_cleanup(void)
        linux_wlan_device_power(0);
 }
 
-int wilc_netdev_init(void)
+int wilc_netdev_init(struct wilc **wilc)
 {
-
        int i;
        perInterface_wlan_t *nic;
        struct net_device *ndev;
@@ -1634,6 +1633,8 @@ int wilc_netdev_init(void)
        if (!g_linux_wlan)
                return -ENOMEM;
 
+       *wilc = g_linux_wlan;
+
        register_inetaddr_notifier(&g_dev_notifier);
 
        for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
index 9a45871e90933a9a4e11fcde02c09a3319de759c..1f8d8743f37610158c80d1a5fb900519ae25b197 100644 (file)
@@ -27,7 +27,6 @@ struct wilc_sdio {
 };
 
 struct sdio_func *local_sdio_func;
-extern int wilc_netdev_init(void);
 extern void wilc_handle_isr(void);
 
 static unsigned int sdio_default_speed;
@@ -117,6 +116,7 @@ int linux_sdio_cmd53(sdio_cmd53_t *cmd)
 static int linux_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
 {
        struct wilc_sdio *wl_sdio;
+       struct wilc *wilc;
 
        PRINT_D(INIT_DBG, "probe function\n");
        wl_sdio = kzalloc(sizeof(struct wilc_sdio), GFP_KERNEL);
@@ -125,12 +125,13 @@ static int linux_sdio_probe(struct sdio_func *func, const struct sdio_device_id
 
        PRINT_D(INIT_DBG, "Initializing netdev\n");
        local_sdio_func = func;
-       if (wilc_netdev_init()) {
+       if (wilc_netdev_init(&wilc)) {
                PRINT_ER("Couldn't initialize netdev\n");
                kfree(wl_sdio);
                return -1;
        }
        wl_sdio->func = func;
+       wl_sdio->wilc = wilc;
        sdio_set_drvdata(func, wl_sdio);
 
        printk("Driver Initializing success\n");
index 74eb7b695d134e98d33b41a555e6431ab7841ecc..e0c66bcdf88a8ef8d15da6795f28f22deee03bd0 100644 (file)
@@ -214,4 +214,5 @@ void linux_wlan_rx_complete(void);
 void linux_wlan_dbg(u8 *buff);
 int linux_wlan_lock_timeout(void *vp, u32 timeout);
 void wl_wlan_cleanup(void);
+int wilc_netdev_init(struct wilc **wilc);
 #endif