From patchwork Tue Oct 27 09:27:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glen Lee X-Patchwork-Id: 7495031 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 4C3C8BEEA4 for ; Tue, 27 Oct 2015 09:26:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7EAB720394 for ; Tue, 27 Oct 2015 09:25:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8058020279 for ; Tue, 27 Oct 2015 09:25:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753397AbbJ0JZ4 (ORCPT ); Tue, 27 Oct 2015 05:25:56 -0400 Received: from eusmtp01.atmel.com ([212.144.249.243]:57992 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751646AbbJ0JZ4 (ORCPT ); Tue, 27 Oct 2015 05:25:56 -0400 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; Tue, 27 Oct 2015 10:25:52 +0100 From: Glen Lee To: CC: , , , , , , , , Subject: [PATCH V2 09/27] staging: wilc1000: wlan_initialize_threads: change argument with net_device Date: Tue, 27 Oct 2015 18:27:45 +0900 Message-ID: <1445938083-20445-9-git-send-email-glen.lee@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1445938083-20445-1-git-send-email-glen.lee@atmel.com> References: <1445938083-20445-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, 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 This patch changes function argument with net_device and use netdev private data member wilc instead of g_linux_wlan. And there are assignment code with different value continuously. Take last code. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/linux_wlan.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 8c81de9..4e88cbe 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -1011,31 +1011,34 @@ void linux_to_wlan(wilc_wlan_inp_t *nwi, struct wilc *nic) #endif } -int wlan_initialize_threads(perInterface_wlan_t *nic) +int wlan_initialize_threads(struct net_device *dev) { - + perInterface_wlan_t *nic; + struct wilc *wilc; int ret = 0; + nic = netdev_priv(dev); + wilc = nic->wilc; + PRINT_D(INIT_DBG, "Initializing Threads ...\n"); /* create tx task */ PRINT_D(INIT_DBG, "Creating kthread for transmission\n"); - g_linux_wlan->txq_thread = kthread_run(linux_wlan_txq_task, (void *)g_linux_wlan, "K_TXQ_TASK"); - if (g_linux_wlan->txq_thread == NULL) { + wilc->txq_thread = kthread_run(linux_wlan_txq_task, (void *)wilc, + "K_TXQ_TASK"); + if (!wilc->txq_thread) { PRINT_ER("couldn't create TXQ thread\n"); ret = -ENOBUFS; goto _fail_2; } /* wait for TXQ task to start. */ - down(&g_linux_wlan->txq_thread_started); + down(&wilc->txq_thread_started); return 0; _fail_2: /*De-Initialize 2nd thread*/ - g_linux_wlan->close = 1; - - g_linux_wlan->close = 0; + wilc->close = 0; return ret; } @@ -1084,7 +1087,7 @@ int wilc1000_wlan_init(struct net_device *dev, perInterface_wlan_t *p_nic) } #endif - ret = wlan_initialize_threads(nic); + ret = wlan_initialize_threads(dev); if (ret < 0) { PRINT_ER("Initializing Threads FAILED\n"); ret = -EIO;