From patchwork Mon Feb 22 05:13:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenji Kaneshige X-Patchwork-Id: 81081 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1M5Cepn014144 for ; Mon, 22 Feb 2010 05:13:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751171Ab0BVFNy (ORCPT ); Mon, 22 Feb 2010 00:13:54 -0500 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:60318 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750940Ab0BVFNx (ORCPT ); Mon, 22 Feb 2010 00:13:53 -0500 Received: from m1.gw.fujitsu.co.jp ([10.0.50.71]) by fgwmail5.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id o1M5DpWg027742 for (envelope-from kaneshige.kenji@jp.fujitsu.com); Mon, 22 Feb 2010 14:13:52 +0900 Received: from smail (m1 [127.0.0.1]) by outgoing.m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 8CD5545DE51 for ; Mon, 22 Feb 2010 14:13:51 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (s1.gw.fujitsu.co.jp [10.0.50.91]) by m1.gw.fujitsu.co.jp (Postfix) with ESMTP id 4DE5545DE4F for ; Mon, 22 Feb 2010 14:13:51 +0900 (JST) Received: from s1.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id 31FEE1DB804A for ; Mon, 22 Feb 2010 14:13:51 +0900 (JST) Received: from m108.s.css.fujitsu.com (m108.s.css.fujitsu.com [10.249.87.108]) by s1.gw.fujitsu.co.jp (Postfix) with ESMTP id D3AA11DB8045 for ; Mon, 22 Feb 2010 14:13:50 +0900 (JST) Received: from m108.css.fujitsu.com (m108 [127.0.0.1]) by m108.s.css.fujitsu.com (Postfix) with ESMTP id A7D5742805D; Mon, 22 Feb 2010 14:13:50 +0900 (JST) Received: from [127.0.0.1] (unknown [10.124.100.137]) by m108.s.css.fujitsu.com (Postfix) with ESMTP id 43EF4428058; Mon, 22 Feb 2010 14:13:50 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 Received: from KANE-LIFEBOOK[10.124.100.137] by KANE-LIFEBOOK (FujitsuOutboundMailChecker v1.3.1/9992[10.124.100.137]); Mon, 22 Feb 2010 14:13:43 +0900 (JST) Message-ID: <4B821283.4070605@jp.fujitsu.com> Date: Mon, 22 Feb 2010 14:13:39 +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, rjw@sisk.pl Subject: [PATCH 2/2] PCIe PME: use pci_pcie_cap() References: <4B8211DD.6010601@jp.fujitsu.com> In-Reply-To: <4B8211DD.6010601@jp.fujitsu.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 22 Feb 2010 05:13:54 +0000 (UTC) Index: 20100218/drivers/pci/pcie/pme/pcie_pme.c =================================================================== --- 20100218.orig/drivers/pci/pcie/pme/pcie_pme.c +++ 20100218/drivers/pci/pcie/pme/pcie_pme.c @@ -105,7 +105,7 @@ static void pcie_pme_interrupt_enable(st int rtctl_pos; u16 rtctl; - rtctl_pos = pci_find_capability(dev, PCI_CAP_ID_EXP) + PCI_EXP_RTCTL; + rtctl_pos = pci_pcie_cap(dev) + PCI_EXP_RTCTL; pci_read_config_word(dev, rtctl_pos, &rtctl); if (enable) @@ -124,7 +124,7 @@ static void pcie_pme_clear_status(struct int rtsta_pos; u32 rtsta; - rtsta_pos = pci_find_capability(dev, PCI_CAP_ID_EXP) + PCI_EXP_RTSTA; + rtsta_pos = pci_pcie_cap(dev) + PCI_EXP_RTSTA; pci_read_config_dword(dev, rtsta_pos, &rtsta); rtsta |= PCI_EXP_RTSTA_PME; @@ -278,7 +278,7 @@ static void pcie_pme_work_fn(struct work int rtsta_pos; u32 rtsta; - rtsta_pos = pci_find_capability(port, PCI_CAP_ID_EXP) + PCI_EXP_RTSTA; + rtsta_pos = pci_pcie_cap(port) + PCI_EXP_RTSTA; spin_lock_irq(&data->lock); @@ -332,7 +332,7 @@ static irqreturn_t pcie_pme_irq(int irq, port = ((struct pcie_device *)context)->port; data = get_service_data((struct pcie_device *)context); - rtsta_pos = pci_find_capability(port, PCI_CAP_ID_EXP) + PCI_EXP_RTSTA; + rtsta_pos = pci_pcie_cap(port) + PCI_EXP_RTSTA; spin_lock_irqsave(&data->lock, flags); pci_read_config_dword(port, rtsta_pos, &rtsta);