From patchwork Tue Sep 6 16:31:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guy, Wey-Yi W" X-Patchwork-Id: 1126752 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p86HFDXN003860 for ; Tue, 6 Sep 2011 17:15:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752677Ab1IFRPL (ORCPT ); Tue, 6 Sep 2011 13:15:11 -0400 Received: from mga11.intel.com ([192.55.52.93]:26702 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752493Ab1IFRPG (ORCPT ); Tue, 6 Sep 2011 13:15:06 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 06 Sep 2011 10:15:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.68,339,1312182000"; d="scan'208";a="49558400" Received: from wwguy-huron.jf.intel.com (HELO localhost.localdomain) ([134.134.163.53]) by fmsmga002.fm.intel.com with ESMTP; 06 Sep 2011 10:15:05 -0700 From: Wey-Yi Guy To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach , Wey-Yi Guy Subject: [PATCH 02/10] iwlagn: merge iwl_pci_down and iwl_pci_remove Date: Tue, 6 Sep 2011 09:31:17 -0700 Message-Id: <1315326685-22213-3-git-send-email-wey-yi.w.guy@intel.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1315326685-22213-1-git-send-email-wey-yi.w.guy@intel.com> References: <1315326685-22213-1-git-send-email-wey-yi.w.guy@intel.com> 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 (demeter1.kernel.org [140.211.167.41]); Tue, 06 Sep 2011 17:15:14 +0000 (UTC) From: Emmanuel Grumbach The latter was the only place that called the first. The two functions were split when the iwl_pci_probe called iwl_pci_down upon failure in the probe. Since iwl_pci_probe undoes its work by itself, there is no need to split between iwl_pci_down, and iwl_pci_remove. Thanks to Pavel Roskin for pointing that out. Signed-off-by: Emmanuel Grumbach Signed-off-by: Wey-Yi Guy --- drivers/net/wireless/iwlwifi/iwl-pci.c | 18 ++++++------------ 1 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-pci.c b/drivers/net/wireless/iwlwifi/iwl-pci.c index e41f53e..78a3f8d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-pci.c +++ b/drivers/net/wireless/iwlwifi/iwl-pci.c @@ -483,9 +483,13 @@ out_no_pci: return err; } -static void iwl_pci_down(struct iwl_bus *bus) +static void __devexit iwl_pci_remove(struct pci_dev *pdev) { - struct iwl_pci_bus *pci_bus = (struct iwl_pci_bus *) bus->bus_specific; + struct iwl_shared *shrd = pci_get_drvdata(pdev); + struct iwl_bus *bus = shrd->bus; + struct iwl_pci_bus *pci_bus = IWL_BUS_GET_PCI_BUS(bus); + + iwl_remove(shrd->priv); pci_disable_msi(pci_bus->pci_dev); pci_iounmap(pci_bus->pci_dev, pci_bus->hw_base); @@ -496,16 +500,6 @@ static void iwl_pci_down(struct iwl_bus *bus) kfree(bus); } -static void __devexit iwl_pci_remove(struct pci_dev *pdev) -{ - struct iwl_shared *shrd = pci_get_drvdata(pdev); - struct iwl_bus *bus = shrd->bus; - - iwl_remove(shrd->priv); - - iwl_pci_down(bus); -} - #ifdef CONFIG_PM_SLEEP static int iwl_pci_suspend(struct device *device)