From patchwork Wed Dec 5 20:58:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 1843101 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 A96413FCF2 for ; Wed, 5 Dec 2012 20:58:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754231Ab2LEU6N (ORCPT ); Wed, 5 Dec 2012 15:58:13 -0500 Received: from mail-ea0-f202.google.com ([209.85.215.202]:52314 "EHLO mail-ea0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754200Ab2LEU6K (ORCPT ); Wed, 5 Dec 2012 15:58:10 -0500 Received: by mail-ea0-f202.google.com with SMTP id j12so394910eaa.1 for ; Wed, 05 Dec 2012 12:58:07 -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=RA4hQcAjlyMUAnKCMi/hFgO4WL+7ViRpODap3UptT8Y=; b=MxXFubhpQC0TmswArUTQbAu77iiVL0BTMvSo1QOLH2GigTHlNmYgTjARG663EtX6I4 NV8cCvmKbUzZ7PDgi8uB5MWNDI8Re/FVyf9Xj3CwbeLw/cS3lT1nI7IQMymJAJXHjAFv 0PdmIxnRB0BO04+hbkV9mKPOHmkrUGkyo8HNvc95JdgG1K4saheReMF9zfQf8IJpharo jjeDUlEGXnWn7/SFxVP11aeXTMlP73xzbdbtbRWQwWaE4cCeigcSLMLBiz8MegSBRG4a yN4ljDmZei/UWvF39jTZYCxJVJV29NVVZs2pzbkcUfy7M3CfQDsrMkyV5lTvHrnnylER CpHw== 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=RA4hQcAjlyMUAnKCMi/hFgO4WL+7ViRpODap3UptT8Y=; b=HfylZRvDCM0aj+udUOOO5cppO5Dxm0pGJV3akPuvmAqMBwa6ApaFgFjU+t6OruMwzG BjxB6GWeYnRGAn6s6ECQOriWRAXpiK+iqQAulvjh/yBhXRQ6hyauIcp9ovKeQAaHIquK FtYchTsewfOjI8JRWpi6lTibZTyMxzqzHHn1/wr4zxlZOcL2uc0+dvSvfs6iRNTVHqsd 0VhfbV72Go6I+YYjPjn9Gh9Nt0EtBj5zwJTqMYfZ84jW85IAYaHcaXK+vJ4OQALhY/Uc Hhu4Vju3Hkwhw9WxhLIIiEA99/LmZ1p2Xh5Lr7FBs7b9KaDBnNJDhCuzEcDf/4h8AuVX Mjig== Received: by 10.14.173.136 with SMTP id v8mr19283975eel.2.1354741087357; Wed, 05 Dec 2012 12:58:07 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id g9si765218eeo.1.2012.12.05.12.58.07 (version=TLSv1/SSLv3 cipher=AES128-SHA); Wed, 05 Dec 2012 12:58:07 -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 009D5200059; Wed, 5 Dec 2012 12:58:07 -0800 (PST) Received: from bhelgaas.mtv.corp.google.com (unknown [IPv6:::1]) by bhelgaas.mtv.corp.google.com (Postfix) with ESMTP id 4AEB2180280; Wed, 5 Dec 2012 12:58:06 -0800 (PST) Subject: [PATCH 09/12] iwlegacy: collapse wrapper for pcie_capability_read_word() To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: linux-wireless@vger.kernel.org, Stanislaw Gruszka , "John W. Linville" Date: Wed, 05 Dec 2012 13:58:06 -0700 Message-ID: <20121205205806.13851.18014.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: ALoCoQmejPtkDUhfBvzflMA1HyuW7OXuhc577BT95j5ck4X0BqjCJD3DJzovOxFdh/rO41fEcPiao/pGGqFnYJg67F7t6kU1OUkB1av8mxtOp7s1pBFBX/l4u0m6kqx7j+iUI8ckTSbxDXz76s+F/gc6VKyu1VhJPRKwo9mE1u561VFPe/MN0RZ+ezyS7J0iEpm2ubdPNsDGn7Xmgr0U++eUFM4sQ1dohw== Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org il_pcie_link_ctl() 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: Stanislaw Gruszka CC: linux-wireless@vger.kernel.org Acked-by: Stanislaw Gruszka --- drivers/net/wireless/iwlegacy/common.c | 5 +++-- drivers/net/wireless/iwlegacy/common.h | 8 -------- 2 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/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c index 318ed3c..1811507 100644 --- a/drivers/net/wireless/iwlegacy/common.c +++ b/drivers/net/wireless/iwlegacy/common.c @@ -1183,8 +1183,9 @@ EXPORT_SYMBOL(il_power_update_mode); void il_power_initialize(struct il_priv *il) { - u16 lctl = il_pcie_link_ctl(il); + u16 lctl; + pcie_capability_read_word(il->pci_dev, PCI_EXP_LNKCTL, &lctl); il->power_data.pci_pm = !(lctl & PCI_CFG_LINK_CTRL_VAL_L0S_EN); il->power_data.debug_sleep_level_override = -1; @@ -4233,7 +4234,7 @@ il_apm_init(struct il_priv *il) * power savings, even without L1. */ if (il->cfg->set_l0s) { - lctl = il_pcie_link_ctl(il); + pcie_capability_read_word(il->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 */ diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h index b4bb813..c9a5022 100644 --- a/drivers/net/wireless/iwlegacy/common.h +++ b/drivers/net/wireless/iwlegacy/common.h @@ -1829,14 +1829,6 @@ int il_enqueue_hcmd(struct il_priv *il, struct il_host_cmd *cmd); * PCI * *****************************************************/ -static inline u16 -il_pcie_link_ctl(struct il_priv *il) -{ - u16 pci_lnk_ctl; - pcie_capability_read_word(il->pci_dev, PCI_EXP_LNKCTL, &pci_lnk_ctl); - return pci_lnk_ctl; -} - void il_bg_watchdog(unsigned long data); u32 il_usecs_to_beacons(struct il_priv *il, u32 usec, u32 beacon_interval); __le32 il_add_beacon_time(struct il_priv *il, u32 base, u32 addon,