From patchwork Fri Nov 27 06:50:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glen Lee X-Patchwork-Id: 7711151 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 1371C9F2E9 for ; Fri, 27 Nov 2015 06:47:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 20A28205DD for ; Fri, 27 Nov 2015 06:47:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 03A7D205B4 for ; Fri, 27 Nov 2015 06:47:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753885AbbK0Grc (ORCPT ); Fri, 27 Nov 2015 01:47:32 -0500 Received: from eusmtp01.atmel.com ([212.144.249.243]:10322 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752010AbbK0Gra (ORCPT ); Fri, 27 Nov 2015 01:47:30 -0500 Received: from glen-ubuntu.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.31) with Microsoft SMTP Server id 14.3.235.1; Fri, 27 Nov 2015 07:47:22 +0100 From: Glen Lee To: CC: , , , , , , , , Subject: [PATCH 3/3] staging: wilc1000: remove duplicate netdev Date: Fri, 27 Nov 2015 15:50:33 +0900 Message-ID: <1448607033-25354-4-git-send-email-glen.lee@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448607033-25354-1-git-send-email-glen.lee@atmel.com> References: <1448607033-25354-1-git-send-email-glen.lee@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, T_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 There are two net_device pointer which is the same because two structures are merged into wilc_vif in previous patch. Remove wilc_netdev and change with ndev. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan.c | 35 +++++++++++------------ drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 +-- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 - 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 810d7ce..bb3ff49 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -440,8 +440,8 @@ int wilc_wlan_get_firmware(struct net_device *dev) goto _fail_; } - if (!(&vif->wilc_netdev->dev)) { - PRINT_ER("&vif->wilc_netdev->dev is NULL\n"); + if (!(&vif->ndev->dev)) { + PRINT_ER("&vif->ndev->dev is NULL\n"); goto _fail_; } @@ -1010,7 +1010,7 @@ int wilc_mac_open(struct net_device *ndev) vif = netdev_priv(ndev); wilc = vif->wilc; - priv = wiphy_priv(vif->wilc_netdev->ieee80211_ptr->wiphy); + priv = wiphy_priv(vif->ndev->ieee80211_ptr->wiphy); PRINT_D(INIT_DBG, "MAC OPEN[%p]\n", ndev); ret = wilc_init_host_int(ndev); @@ -1050,12 +1050,12 @@ int wilc_mac_open(struct net_device *ndev) return -EINVAL; } - wilc_mgmt_frame_register(vif->wilc_netdev->ieee80211_ptr->wiphy, - vif->wilc_netdev->ieee80211_ptr, + wilc_mgmt_frame_register(vif->ndev->ieee80211_ptr->wiphy, + vif->ndev->ieee80211_ptr, vif->g_struct_frame_reg[0].frame_type, vif->g_struct_frame_reg[0].reg); - wilc_mgmt_frame_register(vif->wilc_netdev->ieee80211_ptr->wiphy, - vif->wilc_netdev->ieee80211_ptr, + wilc_mgmt_frame_register(vif->ndev->ieee80211_ptr->wiphy, + vif->ndev->ieee80211_ptr, vif->g_struct_frame_reg[1].frame_type, vif->g_struct_frame_reg[1].reg); netif_wake_queue(ndev); @@ -1204,13 +1204,13 @@ int wilc_mac_close(struct net_device *ndev) vif = netdev_priv(ndev); - if (!vif || !vif->wilc_netdev || !vif->wilc_netdev->ieee80211_ptr || - !vif->wilc_netdev->ieee80211_ptr->wiphy) { + if (!vif || !vif->ndev || !vif->ndev->ieee80211_ptr || + !vif->ndev->ieee80211_ptr->wiphy) { PRINT_ER("vif = NULL\n"); return 0; } - priv = wiphy_priv(vif->wilc_netdev->ieee80211_ptr->wiphy); + priv = wiphy_priv(vif->ndev->ieee80211_ptr->wiphy); wl = vif->wilc; if (!priv) { @@ -1239,10 +1239,10 @@ int wilc_mac_close(struct net_device *ndev) return 0; } - if (vif->wilc_netdev) { - netif_stop_queue(vif->wilc_netdev); + if (vif->ndev) { + netif_stop_queue(vif->ndev); - wilc_deinit_host_int(vif->wilc_netdev); + wilc_deinit_host_int(vif->ndev); } if (wl->open_ifcs == 0) { @@ -1288,7 +1288,7 @@ static int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd) return PTR_ERR(buff); if (strncasecmp(buff, "RSSI", length) == 0) { - priv = wiphy_priv(vif->wilc_netdev->ieee80211_ptr->wiphy); + priv = wiphy_priv(vif->ndev->ieee80211_ptr->wiphy); ret = wilc_get_rssi(priv->hWILCWFIDrv, &rssi); if (ret) PRINT_ER("Failed to send get rssi param's message queue "); @@ -1457,7 +1457,6 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, strcpy(ndev->name, "p2p%d"); vif->u8IfIdx = wl->vif_num; - vif->wilc_netdev = ndev; vif->wilc = *wilc; wl->vif[i] = vif; wl->vif[wl->vif_num]->ndev = ndev; @@ -1476,9 +1475,9 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, return -1; } - vif->wilc_netdev->ieee80211_ptr = wdev; - vif->wilc_netdev->ml_priv = vif; - wdev->netdev = vif->wilc_netdev; + vif->ndev->ieee80211_ptr = wdev; + vif->ndev->ml_priv = vif; + wdev->netdev = vif->ndev; vif->netstats.rx_packets = 0; vif->netstats.tx_packets = 0; vif->netstats.rx_bytes = 0; diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c index d128fb6..87f8d0d 100644 --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c @@ -2621,8 +2621,8 @@ static struct wireless_dev *add_virtual_intf(struct wiphy *wiphy, if (type == NL80211_IFTYPE_MONITOR) { PRINT_D(HOSTAPD_DBG, "Monitor interface mode: Initializing mon interface virtual device driver\n"); - PRINT_D(HOSTAPD_DBG, "Adding monitor interface[%p]\n", vif->wilc_netdev); - new_ifc = WILC_WFI_init_mon_interface(name, vif->wilc_netdev); + PRINT_D(HOSTAPD_DBG, "Adding monitor interface[%p]\n", vif->ndev); + new_ifc = WILC_WFI_init_mon_interface(name, vif->ndev); if (new_ifc) { PRINT_D(HOSTAPD_DBG, "Setting monitor flag in private structure\n"); vif = netdev_priv(priv->wdev->netdev); diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 9f5eac8..98ac8ed 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -154,7 +154,6 @@ struct wilc_vif { int monitor_flag; int mac_opened; struct_frame_reg g_struct_frame_reg[num_reg_frame]; - struct net_device *wilc_netdev; struct net_device_stats netstats; struct wilc *wilc; u8 src_addr[ETH_ALEN];