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: 1843121 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 5B4203FCF2 for ; Wed, 5 Dec 2012 20:58:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751869Ab2LEU6R (ORCPT ); Wed, 5 Dec 2012 15:58:17 -0500 Received: from mail-bk0-f74.google.com ([209.85.214.74]:63932 "EHLO mail-bk0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754230Ab2LEU6O (ORCPT ); Wed, 5 Dec 2012 15:58:14 -0500 Received: by mail-bk0-f74.google.com with SMTP id je9so394100bkc.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=NlDIJyJ5KjJ9Szg7pZnR57Rd2yyjo21Hp83FRsLYWGLm0u/2CDneNtn99VKGTqwFfP eCo+eWmkqe9aZqfgd/avi4UoQjz8q9wVuD1WwgoYrAAdCdVR9b1G9ztxsS1+uV7q1km6 BS+egJvipm6ny8qICWFn64Yeli+MZgXqzCFIP0MMG2tj7Q5TVOo801tHhvjBu/VRsMk2 tvi2xNTcsnqUU5hmotIIUPISKEUmGJ1Fl16k4PGyj6w5neJ/1AK6zqdPEhEHJDIMgDDY qlqp/q2+5hl9lBI6lBVlkcvW8jMQGGdu62YoS5YJVe/xCDj7CR4ZrO2nwaO/43yMzo5B bToQ== 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: ALoCoQniELj4haNf5IC7cb6NAiDiY8uwiQrK6gGsrtyW1WQKTHGkY3wuFc5qKVd4dqeHUvOSilld5z3g2UqwUen6vjUXjE+750aycHkIfaBMbRkzCyrdyBEROPLnhqyUm/uWgHZqBQm/L+bvu0Q1aYMgGvwvCxBHfuGCB4p+5AWpLHfNw8g0FfzBxPEDsV/oK0YjiH8K48HUOnVP8gavqIWycwUiFS/M1g== Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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-wireless" 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 */