Commit ed760b67 authored by Glen Lee's avatar Glen Lee Committed by Greg Kroah-Hartman

staging: wilc1000: linux_wlan_firmware_download: change argument

This patch changes argument p_nic with wilc and use it instead of
g_linux_wlan. Pass argument dev to the function.
Signed-off-by: default avatarGlen Lee <glen.lee@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7af0522c
...@@ -597,12 +597,16 @@ static int linux_wlan_start_firmware(perInterface_wlan_t *nic) ...@@ -597,12 +597,16 @@ static int linux_wlan_start_firmware(perInterface_wlan_t *nic)
_fail_: _fail_:
return ret; return ret;
} }
static int linux_wlan_firmware_download(struct wilc *p_nic) static int linux_wlan_firmware_download(struct net_device *dev)
{ {
perInterface_wlan_t *nic;
struct wilc *wilc;
int ret = 0; int ret = 0;
if (!g_linux_wlan->firmware) { nic = netdev_priv(dev);
wilc = nic->wilc;
if (!wilc->firmware) {
PRINT_ER("Firmware buffer is NULL\n"); PRINT_ER("Firmware buffer is NULL\n");
ret = -ENOBUFS; ret = -ENOBUFS;
goto _FAIL_; goto _FAIL_;
...@@ -611,15 +615,15 @@ static int linux_wlan_firmware_download(struct wilc *p_nic) ...@@ -611,15 +615,15 @@ static int linux_wlan_firmware_download(struct wilc *p_nic)
* do the firmware download * do the firmware download
**/ **/
PRINT_D(INIT_DBG, "Downloading Firmware ...\n"); PRINT_D(INIT_DBG, "Downloading Firmware ...\n");
ret = wilc_wlan_firmware_download(g_linux_wlan->firmware->data, ret = wilc_wlan_firmware_download(wilc->firmware->data,
g_linux_wlan->firmware->size); wilc->firmware->size);
if (ret < 0) if (ret < 0)
goto _FAIL_; goto _FAIL_;
/* Freeing FW buffer */ /* Freeing FW buffer */
PRINT_D(INIT_DBG, "Freeing FW buffer ...\n"); PRINT_D(INIT_DBG, "Freeing FW buffer ...\n");
PRINT_D(INIT_DBG, "Releasing firmware\n"); PRINT_D(INIT_DBG, "Releasing firmware\n");
release_firmware(g_linux_wlan->firmware); release_firmware(wilc->firmware);
PRINT_D(INIT_DBG, "Download Succeeded\n"); PRINT_D(INIT_DBG, "Download Succeeded\n");
...@@ -1123,7 +1127,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic) ...@@ -1123,7 +1127,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic)
} }
/*Download firmware*/ /*Download firmware*/
ret = linux_wlan_firmware_download(wl); ret = linux_wlan_firmware_download(dev);
if (ret < 0) { if (ret < 0) {
PRINT_ER("Failed to download firmware\n"); PRINT_ER("Failed to download firmware\n");
ret = -EIO; ret = -EIO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment