From patchwork Wed Nov 11 05:31:38 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenji Kaneshige X-Patchwork-Id: 59264 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 nAB5VVT6029214 for ; Wed, 11 Nov 2009 05:31:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751035AbZKKFbu (ORCPT ); Wed, 11 Nov 2009 00:31:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751256AbZKKFbu (ORCPT ); Wed, 11 Nov 2009 00:31:50 -0500 Received: from fgwmail6.fujitsu.co.jp ([192.51.44.36]:57616 "EHLO fgwmail6.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751035AbZKKFbu (ORCPT ); Wed, 11 Nov 2009 00:31:50 -0500 Received: from m2.gw.fujitsu.co.jp ([10.0.50.72]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id nAB5Vstc011440 for (envelope-from kaneshige.kenji@jp.fujitsu.com); Wed, 11 Nov 2009 14:31:55 +0900 Received: from smail (m2 [127.0.0.1]) by outgoing.m2.gw.fujitsu.co.jp (Postfix) with ESMTP id 8D65E45DE61 for ; Wed, 11 Nov 2009 14:31:54 +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 68C5245DE51 for ; Wed, 11 Nov 2009 14:31:54 +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 4A181E38003 for ; Wed, 11 Nov 2009 14:31:54 +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 E76C8E38005 for ; Wed, 11 Nov 2009 14:31:53 +0900 (JST) Received: from m106.css.fujitsu.com (m106 [127.0.0.1]) by m106.s.css.fujitsu.com (Postfix) with ESMTP id BE0EB5B8870; Wed, 11 Nov 2009 14:31:53 +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 625325B8793; Wed, 11 Nov 2009 14:31:53 +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:43 +0900 (JST) Message-ID: <4AFA4C3A.1020609@jp.fujitsu.com> Date: Wed, 11 Nov 2009 14:31:38 +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 3/12] PCIe AER: use pci_pcie_cap() 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/pcie/aer/aerdrv.c =================================================================== --- 20091110.orig/drivers/pci/pcie/aer/aerdrv.c +++ 20091110/drivers/pci/pcie/aer/aerdrv.c @@ -295,7 +295,7 @@ static void aer_error_resume(struct pci_ u16 reg16; /* Clean up Root device status */ - pos = pci_find_capability(dev, PCI_CAP_ID_EXP); + pos = pci_pcie_cap(dev); pci_read_config_word(dev, pos + PCI_EXP_DEVSTA, ®16); pci_write_config_word(dev, pos + PCI_EXP_DEVSTA, reg16); Index: 20091110/drivers/pci/pcie/aer/aerdrv_core.c =================================================================== --- 20091110.orig/drivers/pci/pcie/aer/aerdrv_core.c +++ 20091110/drivers/pci/pcie/aer/aerdrv_core.c @@ -42,7 +42,7 @@ int pci_enable_pcie_error_reporting(stru if (!pos) return -EIO; - pos = pci_find_capability(dev, PCI_CAP_ID_EXP); + pos = pci_pcie_cap(dev); if (!pos) return -EIO; @@ -66,7 +66,7 @@ int pci_disable_pcie_error_reporting(str if (dev->aer_firmware_first) return -EIO; - pos = pci_find_capability(dev, PCI_CAP_ID_EXP); + pos = pci_pcie_cap(dev); if (!pos) return -EIO; @@ -224,7 +224,7 @@ static int find_device_iter(struct pci_d */ if (atomic_read(&dev->enable_cnt) == 0) return 0; - pos = pci_find_capability(dev, PCI_CAP_ID_EXP); + pos = pci_pcie_cap(dev); if (!pos) return 0; /* Check if AER is enabled */ @@ -618,7 +618,7 @@ void aer_enable_rootport(struct aer_rpc u16 reg16; u32 reg32; - pos = pci_find_capability(pdev, PCI_CAP_ID_EXP); + pos = pci_pcie_cap(pdev); /* Clear PCIE Capability's Device Status */ pci_read_config_word(pdev, pos+PCI_EXP_DEVSTA, ®16); pci_write_config_word(pdev, pos+PCI_EXP_DEVSTA, reg16);