From patchwork Tue Jul 10 17:23:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Luis R. Rodriguez" X-Patchwork-Id: 1178621 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E837F40B37 for ; Tue, 10 Jul 2012 17:24:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756529Ab2GJRYo (ORCPT ); Tue, 10 Jul 2012 13:24:44 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:26001 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754281Ab2GJRYo (ORCPT ); Tue, 10 Jul 2012 13:24:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1341941085; x=1373477085; h=cc:from:to:subject:date:message-id:in-reply-to: references:mime-version; bh=2E3EUs3eI/MBkYt5+8fHWWx4bv3iNh/Md4WM8gb2CMU=; b=nVUznqYF/3Ka8/QnHBpMdstmppFOcEiMA4eTojAFUcYgnwhcMlMhRgMq wHm3B0ttBGZ8+kELnHfBMDU+urHSq+JhYpRXMtkbFjonG+sPOTslpq9YL amehKlm9V4otrZOl6T7qZrnMbjio+inTyZ5hNaqHZCgRqdtVE6sWFMpCr M=; X-IronPort-AV: E=McAfee;i="5400,1158,6768"; a="206784991" Received: from ironmsg03-r.qualcomm.com ([172.30.46.17]) by wolverine02.qualcomm.com with ESMTP; 10 Jul 2012 10:24:44 -0700 Cc: , , , , , "Luis R. Rodriguez" X-IronPort-AV: E=Sophos;i="4.77,560,1336374000"; d="scan'208";a="286963211" Received: from nasanexhc08.na.qualcomm.com ([172.30.39.7]) by Ironmsg03-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 10 Jul 2012 10:24:44 -0700 Received: from tux (172.30.39.5) by qcmail1.qualcomm.com (172.30.39.7) with Microsoft SMTP Server (TLS) id 14.2.309.2; Tue, 10 Jul 2012 10:24:42 -0700 Received: by tux (sSMTP sendmail emulation); Tue, 10 Jul 2012 10:24:41 -0700 From: "Luis R. Rodriguez" To: , Subject: [PATCH v4 5/5] cfg80211: remove regulatory_update() Date: Tue, 10 Jul 2012 10:23:11 -0700 Message-ID: <1341940991-11234-6-git-send-email-rodrigue@qca.qualcomm.com> X-Mailer: git-send-email 1.7.10.rc1.22.gf5241 In-Reply-To: <1341940991-11234-1-git-send-email-rodrigue@qca.qualcomm.com> References: <1341940991-11234-1-git-send-email-rodrigue@qca.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [172.30.39.5] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: "Luis R. Rodriguez" regulatory_update() just calls wiphy_update_regulatory(). wiphy_update_regulatory() assumes you already have the reg_mutex held so just move the call within locking context and kill the superfluous regulatory_update(). Signed-off-by: Luis R. Rodriguez --- net/wireless/reg.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/net/wireless/reg.c b/net/wireless/reg.c index b0a09b2..6d57e18 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -1232,14 +1232,6 @@ static void wiphy_update_regulatory(struct wiphy *wiphy, wiphy->reg_notifier(wiphy, last_request); } -static void regulatory_update(struct wiphy *wiphy, - enum nl80211_reg_initiator setby) -{ - mutex_lock(®_mutex); - wiphy_update_regulatory(wiphy, setby); - mutex_unlock(®_mutex); -} - static void update_all_wiphy_regulatory(enum nl80211_reg_initiator initiator) { struct cfg80211_registered_device *rdev; @@ -2384,9 +2376,9 @@ void wiphy_regulatory_register(struct wiphy *wiphy) if (!reg_dev_ignore_cell_hint(wiphy)) reg_num_devs_support_basehint++; - mutex_unlock(®_mutex); + wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE); - regulatory_update(wiphy, NL80211_REGDOM_SET_BY_CORE); + mutex_unlock(®_mutex); } /* Caller must hold cfg80211_mutex */