From patchwork Thu Jul 14 21:29:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Franky Lin X-Patchwork-Id: 976142 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6ELV03p008678 for ; Thu, 14 Jul 2011 21:31:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932451Ab1GNVaz (ORCPT ); Thu, 14 Jul 2011 17:30:55 -0400 Received: from mms1.broadcom.com ([216.31.210.17]:4273 "EHLO mms1.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932413Ab1GNVaC (ORCPT ); Thu, 14 Jul 2011 17:30:02 -0400 Received: from [10.9.200.133] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Thu, 14 Jul 2011 14:34:52 -0700 X-Server-Uuid: 02CED230-5797-4B57-9875-D5D2FEE4708A Received: from mail-irva-13.broadcom.com (10.11.16.103) by IRVEXCHHUB02.corp.ad.broadcom.com (10.9.200.133) with Microsoft SMTP Server id 8.2.247.2; Thu, 14 Jul 2011 14:29:24 -0700 Received: from mail-sj1-12.sj.broadcom.com (mail-sj1-12.sj.broadcom.com [10.17.16.106]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 8BBF274D04; Thu, 14 Jul 2011 14:29:38 -0700 (PDT) Received: from lc-sj1-3560.broadcom.com (lc-sj1-3560.sj.broadcom.com [10.17.194.250]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id A323E20516; Thu, 14 Jul 2011 14:29:33 -0700 (PDT) Received: by lc-sj1-3560.broadcom.com (Postfix, from userid 25250) id 65A632C19D1E; Thu, 14 Jul 2011 14:29:31 -0700 (PDT) From: "Franky Lin" To: gregkh@suse.de cc: devel@linuxdriverproject.org, linux-wireless@vger.kernel.org Subject: [PATCH 19/35] staging: brcm80211: remove duplicated code from brcmf_init_iscan Date: Thu, 14 Jul 2011 14:29:15 -0700 Message-ID: <1310678971-28952-20-git-send-email-frankyl@broadcom.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1310678971-28952-1-git-send-email-frankyl@broadcom.com> References: <1310678971-28952-1-git-send-email-frankyl@broadcom.com> MIME-Version: 1.0 X-WSS-ID: 6201BF733B420695917-14-01 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 14 Jul 2011 21:31:00 +0000 (UTC) From: Arend van Spriel Part of the code in brcmf_init_scan was identical to the code in brcmf_invoke_iscan and has been replaced by a call to it. Signed-off-by: Arend van Spriel Reviewed-by: Roland Vossen Reviewed-by: Franky Lin --- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 15 ++++----------- 1 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c index e9ccf06..a69fa93 100644 --- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c @@ -3343,7 +3343,6 @@ static void brcmf_iscan_timer(unsigned long data) static s32 brcmf_invoke_iscan(struct brcmf_cfg80211_priv *cfg_priv) { struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_to_iscan(cfg_priv); - int err = 0; if (cfg_priv->iscan_on && !iscan->tsk) { iscan->state = WL_ISCAN_STATE_IDLE; @@ -3356,7 +3355,7 @@ static s32 brcmf_invoke_iscan(struct brcmf_cfg80211_priv *cfg_priv) } } - return err; + return 0; } static void brcmf_init_iscan_eloop(struct brcmf_cfg80211_iscan_eloop *el) @@ -3376,20 +3375,14 @@ static s32 brcmf_init_iscan(struct brcmf_cfg80211_priv *cfg_priv) if (cfg_priv->iscan_on) { iscan->dev = cfg_to_ndev(cfg_priv); - iscan->state = WL_ISCAN_STATE_IDLE; brcmf_init_iscan_eloop(&iscan->el); iscan->timer_ms = WL_ISCAN_TIMER_INTERVAL_MS; init_timer(&iscan->timer); iscan->timer.data = (unsigned long) iscan; iscan->timer.function = brcmf_iscan_timer; - sema_init(&iscan->sync, 0); - iscan->tsk = kthread_run(brcmf_iscan_thread, iscan, "wl_iscan"); - if (IS_ERR(iscan->tsk)) { - WL_ERR("Could not create iscan thread\n"); - iscan->tsk = NULL; - return -ENOMEM; - } - iscan->data = cfg_priv; + err = brcmf_invoke_iscan(cfg_priv); + if (!err) + iscan->data = cfg_priv; } return err;