Return-path: Received: from mms2.broadcom.com ([216.31.210.18]:1729 "EHLO mms2.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753694Ab1JBRPA (ORCPT ); Sun, 2 Oct 2011 13:15:00 -0400 From: "Franky Lin" To: gregkh@suse.de cc: devel@linuxdriverproject.org, linux-wireless@vger.kernel.org Subject: [PATCH 09/20] staging: brcm80211: only allow one call to add_interface callback Date: Sun, 2 Oct 2011 10:14:34 -0700 Message-ID: <1317575685-3156-10-git-send-email-frankyl@broadcom.com> (sfid-20111002_191531_208448_95E2BB64) In-Reply-To: <1317575685-3156-1-git-send-email-frankyl@broadcom.com> References: <1317575685-3156-1-git-send-email-frankyl@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-wireless-owner@vger.kernel.org List-ID: From: Arend van Spriel The driver only supports one network interface to be associated with it. Only for the first call it does actually something. For subsequent calls it does return -ENODEV error code. Reported-by: Johannes Berg Reviewed-by: Roland Vossen Reviewed-by: Pieter-Paul Giesberts Signed-off-by: Franky Lin --- drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c index 1fa95d7..6787498 100644 --- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c +++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c @@ -341,7 +341,10 @@ brcms_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) wl = hw->priv; LOCK(wl); - err = brcms_up(wl); + if (!wl->pub->up) + err = brcms_up(wl); + else + err = -ENODEV; UNLOCK(wl); if (err != 0) -- 1.7.1