From patchwork Thu Jul 12 18:49:21 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: 1190321 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 52BFCDFFFE for ; Thu, 12 Jul 2012 18:49:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755466Ab2GLStt (ORCPT ); Thu, 12 Jul 2012 14:49:49 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:40177 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755221Ab2GLSts (ORCPT ); Thu, 12 Jul 2012 14:49:48 -0400 Received: by ghrr11 with SMTP id r11so2767419ghr.19 for ; Thu, 12 Jul 2012 11:49:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=uRvcveS8/eII409ZhrIqU7yciCjcFPnYYmCDn8GQtsE=; b=T1MAb5x0rSP7uGcYBoie6dkGFdRD3RXd4awKGuFSM/RCQmN2zPkgkM0coNeqsYuK8R vrurvL1dQzKlOIC+51rbWDw1Jt0QIaaoJS5nbTt0pcDzZCuJm9fm0xM42YvHdbqMMoso MrGSUT4lrn6zL26ABYuSp7RpFJ/vdV/AJ00HgsEskrIdTcV93rXShnruxZ6O+jzBqj70 NrMgf8ZhnI+ErXuQare7NgbkvzAeAjqo9CoqhZuPu/wfuUMHNEq3fYBcJPdy5+6x6UjG hVtSVvCbDu7FbBO5zigCCFnghxDvfOHUlzWz/NPKzF1LCyTGnkB/N3ooqAYC8PMBEOQQ dUzQ== Received: by 10.66.78.42 with SMTP id y10mr92236679paw.31.1342118987765; Thu, 12 Jul 2012 11:49:47 -0700 (PDT) Received: from mcgrof@gmail.com (c-24-7-61-223.hsd1.ca.comcast.net. [24.7.61.223]) by mx.google.com with ESMTPS id oy8sm4333247pbc.52.2012.07.12.11.49.45 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 Jul 2012 11:49:47 -0700 (PDT) Received: by mcgrof@gmail.com (sSMTP sendmail emulation); Thu, 12 Jul 2012 11:49:45 -0700 From: "Luis R. Rodriguez" To: johannes@sipsolutions.net, linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, "Luis R. Rodriguez" Subject: [PATCH v5 5/5] cfg80211: remove regulatory_update() Date: Thu, 12 Jul 2012 11:49:21 -0700 Message-Id: <1342118961-13008-6-git-send-email-mcgrof@qca.qualcomm.com> X-Mailer: git-send-email 1.7.10.rc1.22.gf5241 In-Reply-To: <1342118961-13008-1-git-send-email-mcgrof@qca.qualcomm.com> References: <1342118961-13008-1-git-send-email-mcgrof@qca.qualcomm.com> 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 */