From patchwork Wed Dec 5 20:58:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 1843111 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 471DC3FCF2 for ; Wed, 5 Dec 2012 20:58:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964817Ab2LEU6Q (ORCPT ); Wed, 5 Dec 2012 15:58:16 -0500 Received: from mail-fa0-f74.google.com ([209.85.161.74]:35926 "EHLO mail-fa0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752984Ab2LEU6O (ORCPT ); Wed, 5 Dec 2012 15:58:14 -0500 Received: by mail-fa0-f74.google.com with SMTP id t1so391578fae.1 for ; Wed, 05 Dec 2012 12:58:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=PfPC0dw64W32oeys99ezEOEZS4HJr26YswvRByT0V80=; b=E6MO6MtabQK1YZfOSVW8RyU8L4XpKQIfDDiOiAmsU9yFWM259KQxku4CR79rMID5ZA uA/1BywLYmGR7CAj8Mbi1wlnQ2NVDRTsaUNV8SFAooUlEH7nXkOMl7kMpMzgP4cFBknS bFEvFdH/uTxNU5p/Y6ohWqG2EVIA2sUYICM0dETiWuZuulQv9II/QeeBbxbyDxm3rYR9 1dy3fW48dpBwYuesw9co6cnA2TN5FXO77+QNXgMtaZN+6SV7P7UtqNLc7c6KPOQ7rm0g yt7Xi3GSvf/g3SCY/S6493xxrBlIyEpY2bGbo5d6tnOgqBV5HR5zftseBIjk4PLQt+Yn ugFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=PfPC0dw64W32oeys99ezEOEZS4HJr26YswvRByT0V80=; b=I7vk6cQmaSPV5s9a/arf9VEoBn34IhajPLUvkj7g0ZbJz232UqVQiNMvevIT+Y/i9x bsw4SrulJFLn3eZPEXNyDnKBHXunMyyi9WcnmWOXpDA0HmemGT99larsWQr5v5zNWUGe aBPYaY0f1AGzqADVv9TK+F7VjMlhGw8lqoC+SxIyVn4K4MyevEUpN7R7INjc3wab5qoZ Tbkw5Dypn5E91idl6Pa0jc3icohAiB3unJfz8LZsnqnOJ265r9HzpA81hSL2qi492y2B ooVkWZWWIt2XHJWl50IYFhsA6xHsCz6SRCCyXycLhglWDz/7+CRskUik+E2tAL2NpaT1 xhCQ== Received: by 10.14.214.197 with SMTP id c45mr19213935eep.7.1354741092509; Wed, 05 Dec 2012 12:58:12 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id g9si765204eeo.1.2012.12.05.12.58.12 (version=TLSv1/SSLv3 cipher=AES128-SHA); Wed, 05 Dec 2012 12:58:12 -0800 (PST) Received: from bhelgaas.mtv.corp.google.com (bhelgaas.mtv.corp.google.com [172.17.131.112]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 25429200059; Wed, 5 Dec 2012 12:58:12 -0800 (PST) Received: from bhelgaas.mtv.corp.google.com (unknown [IPv6:::1]) by bhelgaas.mtv.corp.google.com (Postfix) with ESMTP id 7AD30180280; Wed, 5 Dec 2012 12:58:11 -0800 (PST) Subject: [PATCH 10/12] iwlwifi: collapse wrapper for pcie_capability_read_word() To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Intel Linux Wireless , linux-wireless@vger.kernel.org, "John W. Linville" , Johannes Berg , Wey-Yi Guy Date: Wed, 05 Dec 2012 13:58:11 -0700 Message-ID: <20121205205811.13851.77247.stgit@bhelgaas.mtv.corp.google.com> In-Reply-To: <20121205205724.13851.50508.stgit@bhelgaas.mtv.corp.google.com> References: <20121205205724.13851.50508.stgit@bhelgaas.mtv.corp.google.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkF6upxWFXs39RrE9bSrVRioZmIgD2GL8ht6CXXyAA5z0UvrLoIvp7/wKxgW8negGN9wTWiB+Dc9GC2R/TrXAe4SqI0SRS6waPL/xbgXO9iZ/bsN3jiGzIbo6OKwqMyhp8RJYVq5jq07ji1tOMQaWwadfcOmE2RTXVUU1VV5GB8L7Fdg11LyRSMXpJPe/y1SJJT9xSG2K9rT0c1jEYGclNj0r9G7g== Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org iwl_pciexp_link_ctrl() has only one call site and no longer provides any useful abstraction, so collapse it into the caller. Signed-off-by: Bjorn Helgaas CC: "John W. Linville" CC: Johannes Berg CC: Wey-Yi Guy CC: Intel Linux Wireless CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/iwlwifi/pcie/trans.c | 13 +++---------- 1 files changed, 3 insertions(+), 10 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index fe0fffd..5cd06b3 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c @@ -673,18 +673,11 @@ static void iwl_set_pwr_vmain(struct iwl_trans *trans) #define PCI_CFG_LINK_CTRL_VAL_L0S_EN 0x01 #define PCI_CFG_LINK_CTRL_VAL_L1_EN 0x02 -static u16 iwl_pciexp_link_ctrl(struct iwl_trans *trans) +static void iwl_apm_config(struct iwl_trans *trans) { struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); - u16 pci_lnk_ctl; - - pcie_capability_read_word(trans_pcie->pci_dev, PCI_EXP_LNKCTL, - &pci_lnk_ctl); - return pci_lnk_ctl; -} + u16 lctl; -static void iwl_apm_config(struct iwl_trans *trans) -{ /* * HW bug W/A for instability in PCIe bus L0S->L1 transition. * Check if BIOS (or OS) enabled L1-ASPM on this device. @@ -693,8 +686,8 @@ static void iwl_apm_config(struct iwl_trans *trans) * If not (unlikely), enable L0S, so there is at least some * power savings, even without L1. */ - u16 lctl = iwl_pciexp_link_ctrl(trans); + pcie_capability_read_word(trans_pcie->pci_dev, PCI_EXP_LNKCTL, &lctl); if ((lctl & PCI_CFG_LINK_CTRL_VAL_L1_EN) == PCI_CFG_LINK_CTRL_VAL_L1_EN) { /* L1-ASPM enabled; disable(!) L0S */