From patchwork Tue Oct 20 08:13:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Cho X-Patchwork-Id: 7443441 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D3B6A9F36A for ; Tue, 20 Oct 2015 08:14:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EF64820858 for ; Tue, 20 Oct 2015 08:14:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 07B8C2084A for ; Tue, 20 Oct 2015 08:14:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753472AbbJTIO0 (ORCPT ); Tue, 20 Oct 2015 04:14:26 -0400 Received: from eusmtp01.atmel.com ([212.144.249.242]:16871 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753443AbbJTIOY (ORCPT ); Tue, 20 Oct 2015 04:14:24 -0400 Received: from tony-itx.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.30) with Microsoft SMTP Server id 14.3.235.1; Tue, 20 Oct 2015 10:14:21 +0200 From: Tony Cho To: CC: , , , , , , , , Subject: [PATCH 02/13] staging: wilc1000: wilc1000_wlan_init: use netdev private wilc Date: Tue, 20 Oct 2015 17:13:52 +0900 Message-ID: <1445328843-32247-2-git-send-email-tony.cho@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445328843-32247-1-git-send-email-tony.cho@atmel.com> References: <1445328843-32247-1-git-send-email-tony.cho@atmel.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Glen Lee This patch use netdev private data member wilc instead of global variable g_linux_wlan. Signed-off-by: Glen Lee Signed-off-by: Tony Cho --- drivers/staging/wilc1000/linux_wlan.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 8fa6b7c..39341a8 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1027,14 +1027,15 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic) wilc_wlan_inp_t nwi; perInterface_wlan_t *nic = p_nic; int ret = 0; + struct wilc *wl = nic->wilc; - if (!g_linux_wlan->initialized) { - g_linux_wlan->mac_status = WILC_MAC_STATUS_INIT; - g_linux_wlan->close = 0; + if (!wl->initialized) { + wl->mac_status = WILC_MAC_STATUS_INIT; + wl->close = 0; - wlan_init_locks(g_linux_wlan); + wlan_init_locks(wl); - linux_to_wlan(&nwi, g_linux_wlan); + linux_to_wlan(&nwi, wl); ret = wilc_wlan_init(&nwi); if (ret < 0) { @@ -1044,7 +1045,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic) } #if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO) - if (init_irq(g_linux_wlan)) { + if (init_irq(wl)) { PRINT_ER("couldn't initialize IRQ\n"); ret = -EIO; goto _fail_locks_; @@ -1073,7 +1074,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic) } /*Download firmware*/ - ret = linux_wlan_firmware_download(g_linux_wlan); + ret = linux_wlan_firmware_download(wl); if (ret < 0) { PRINT_ER("Failed to download firmware\n"); ret = -EIO; @@ -1101,7 +1102,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic) PRINT_D(INIT_DBG, "***** Firmware Ver = %s *******\n", Firmware_ver); } /* Initialize firmware with default configuration */ - ret = linux_wlan_init_test_config(dev, g_linux_wlan); + ret = linux_wlan_init_test_config(dev, wl); if (ret < 0) { PRINT_ER("Failed to configure firmware\n"); @@ -1109,7 +1110,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic) goto _fail_fw_start_; } - g_linux_wlan->initialized = true; + wl->initialized = true; return 0; /*success*/ _fail_fw_start_: @@ -1121,14 +1122,14 @@ _fail_irq_enable_: _fail_irq_init_: #endif #if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO) - deinit_irq(g_linux_wlan); + deinit_irq(wl); #endif - wlan_deinitialize_threads(g_linux_wlan); + wlan_deinitialize_threads(wl); _fail_wilc_wlan_: wilc_wlan_cleanup(); _fail_locks_: - wlan_deinit_locks(g_linux_wlan); + wlan_deinit_locks(wl); PRINT_ER("WLAN Iinitialization FAILED\n"); } else { PRINT_D(INIT_DBG, "wilc1000 already initialized\n");