From patchwork Tue Oct 20 08:13:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Cho X-Patchwork-Id: 7443471 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 22D2FBEEA4 for ; Tue, 20 Oct 2015 08:14:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5DB632085A for ; Tue, 20 Oct 2015 08:14:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 667CC20859 for ; Tue, 20 Oct 2015 08:14:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753513AbbJTIOo (ORCPT ); Tue, 20 Oct 2015 04:14:44 -0400 Received: from eusmtp01.atmel.com ([212.144.249.242]:16952 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753502AbbJTIOm (ORCPT ); Tue, 20 Oct 2015 04:14:42 -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:39 +0200 From: Tony Cho To: CC: , , , , , , , , Subject: [PATCH 05/13] staging: wilc1000: mac_close: use netdev private wilc instead of g_linux_wlan Date: Tue, 20 Oct 2015 17:13:55 +0900 Message-ID: <1445328843-32247-5-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 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 | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index ebedffa..93475aa 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1383,6 +1383,7 @@ int mac_close(struct net_device *ndev) struct wilc_priv *priv; perInterface_wlan_t *nic; struct host_if_drv *pstrWFIDrv; + struct wilc *wl; nic = netdev_priv(ndev); @@ -1392,6 +1393,7 @@ int mac_close(struct net_device *ndev) } priv = wiphy_priv(nic->wilc_netdev->ieee80211_ptr->wiphy); + wl = nic->wilc; if (priv == NULL) { PRINT_ER("priv = NULL\n"); @@ -1402,8 +1404,8 @@ int mac_close(struct net_device *ndev) PRINT_D(GENERIC_DBG, "Mac close\n"); - if (g_linux_wlan == NULL) { - PRINT_ER("g_linux_wlan = NULL\n"); + if (!wl) { + PRINT_ER("wl = NULL\n"); return 0; } @@ -1412,8 +1414,8 @@ int mac_close(struct net_device *ndev) return 0; } - if ((g_linux_wlan->open_ifcs) > 0) { - g_linux_wlan->open_ifcs--; + if ((wl->open_ifcs) > 0) { + wl->open_ifcs--; } else { PRINT_ER("ERROR: MAC close called while number of opened interfaces is zero\n"); return 0; @@ -1426,10 +1428,10 @@ int mac_close(struct net_device *ndev) wilc_deinit_host_int(nic->wilc_netdev); } - if (g_linux_wlan->open_ifcs == 0) { + if (wl->open_ifcs == 0) { PRINT_D(GENERIC_DBG, "Deinitializing wilc1000\n"); - g_linux_wlan->close = 1; - wilc1000_wlan_deinit(g_linux_wlan); + wl->close = 1; + wilc1000_wlan_deinit(wl); WILC_WFI_deinit_mon_interface(); }