From patchwork Wed Nov 11 05:30:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenji Kaneshige X-Patchwork-Id: 59263 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAB5VVT4029214 for ; Wed, 11 Nov 2009 05:31:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751436AbZKKFbI (ORCPT ); Wed, 11 Nov 2009 00:31:08 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751035AbZKKFbI (ORCPT ); Wed, 11 Nov 2009 00:31:08 -0500 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:58295 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751436AbZKKFbH (ORCPT ); Wed, 11 Nov 2009 00:31:07 -0500 Received: from m2.gw.fujitsu.co.jp ([10.0.50.72]) by fgwmail7.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id nAB5VCPr010318 for (envelope-from kaneshige.kenji@jp.fujitsu.com); Wed, 11 Nov 2009 14:31:12 +0900 Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id EE40545DE5D for ; Wed, 11 Nov 2009 14:31:11 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (s2.gw.fujitsu.co.jp [10.0.50.92]) by m2.gw.fujitsu.co.jp (Postfix) with ESMTP id AE47D45DE55 for ; Wed, 11 Nov 2009 14:31:11 +0900 (JST) Received: from s2.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 79D90E3800F for ; Wed, 11 Nov 2009 14:31:11 +0900 (JST) Received: from m106.s.css.fujitsu.com (m106.s.css.fujitsu.com [10.249.87.106]) by s2.gw.fujitsu.co.jp (Postfix) with ESMTP id 23272E38005 for ; Wed, 11 Nov 2009 14:31:11 +0900 (JST) Received: from m106.css.fujitsu.com (m106 [127.0.0.1]) by m106.s.css.fujitsu.com (Postfix) with ESMTP id DD83E5B8793; Wed, 11 Nov 2009 14:31:10 +0900 (JST) Received: from [127.0.0.1] (KANE-LIFEBOOK.numD3.wlan.css.fujitsu.com [10.124.134.33]) by m106.s.css.fujitsu.com (Postfix) with ESMTP id 6DCD45B89FF; Wed, 11 Nov 2009 14:31:10 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Received: from KANE-LIFEBOOK[10.124.134.33] by KANE-LIFEBOOK (FujitsuOutboundMailChecker v1.3.1/9992[10.124.134.33]); Wed, 11 Nov 2009 14:31:00 +0900 (JST) Message-ID: <4AFA4C10.9040606@jp.fujitsu.com> Date: Wed, 11 Nov 2009 14:30:56 +0900 From: Kenji Kaneshige User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: linux-pci@vger.kernel.org, jbarnes@virtuousgeek.org CC: bjorn.helgaas@hp.com, matthew@wil.cx Subject: [PATCH 2/12] PCI: use pci_pcie_cap() in pci core References: <4AFA4B99.4010609@jp.fujitsu.com> In-Reply-To: <4AFA4B99.4010609@jp.fujitsu.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Index: 20091110/drivers/pci/pci.c =================================================================== --- 20091110.orig/drivers/pci/pci.c +++ 20091110/drivers/pci/pci.c @@ -737,8 +737,8 @@ static int pci_save_pcie_state(struct pc u16 *cap; u16 flags; - pos = pci_find_capability(dev, PCI_CAP_ID_EXP); - if (pos <= 0) + pos = pci_pcie_cap(dev); + if (!pos) return 0; save_state = pci_find_saved_cap(dev, PCI_CAP_ID_EXP); @@ -1531,7 +1531,7 @@ void pci_enable_ari(struct pci_dev *dev) if (!bridge || !bridge->is_pcie) return; - pos = pci_find_capability(bridge, PCI_CAP_ID_EXP); + pos = pci_pcie_cap(bridge); if (!pos) return; @@ -2136,7 +2136,7 @@ static int pcie_flr(struct pci_dev *dev, u32 cap; u16 status; - pos = pci_find_capability(dev, PCI_CAP_ID_EXP); + pos = pci_pcie_cap(dev); if (!pos) return -ENOTTY; @@ -2485,7 +2485,7 @@ int pcie_get_readrq(struct pci_dev *dev) int ret, cap; u16 ctl; - cap = pci_find_capability(dev, PCI_CAP_ID_EXP); + cap = pci_pcie_cap(dev); if (!cap) return -EINVAL; @@ -2515,7 +2515,7 @@ int pcie_set_readrq(struct pci_dev *dev, v = (ffs(rq) - 8) << 12; - cap = pci_find_capability(dev, PCI_CAP_ID_EXP); + cap = pci_pcie_cap(dev); if (!cap) goto out; Index: 20091110/drivers/pci/probe.c =================================================================== --- 20091110.orig/drivers/pci/probe.c +++ 20091110/drivers/pci/probe.c @@ -703,7 +703,7 @@ static void set_pcie_hotplug_bridge(stru u16 reg16; u32 reg32; - pos = pci_find_capability(pdev, PCI_CAP_ID_EXP); + pos = pci_pcie_cap(pdev); if (!pos) return; pci_read_config_word(pdev, pos + PCI_EXP_FLAGS, ®16); @@ -920,7 +920,7 @@ int pci_cfg_space_size(struct pci_dev *d if (class == PCI_CLASS_BRIDGE_HOST) return pci_cfg_space_size_ext(dev); - pos = pci_find_capability(dev, PCI_CAP_ID_EXP); + pos = pci_pcie_cap(dev); if (!pos) { pos = pci_find_capability(dev, PCI_CAP_ID_PCIX); if (!pos)