From patchwork Fri Jan 9 09:26:54 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Brown X-Patchwork-Id: 1511 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 n099PaGs003448 for ; Fri, 9 Jan 2009 01:25:36 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754590AbZAIJ3H (ORCPT ); Fri, 9 Jan 2009 04:29:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754793AbZAIJ3G (ORCPT ); Fri, 9 Jan 2009 04:29:06 -0500 Received: from vms173007pub.verizon.net ([206.46.173.7]:56372 "EHLO vms173007pub.verizon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753824AbZAIJ23 (ORCPT ); Fri, 9 Jan 2009 04:28:29 -0500 Received: from localhost.localdomain ([96.237.168.40]) by vms173007.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0KD70042B68R15D6@vms173007.mailsrvcs.net> for linux-acpi@vger.kernel.org; Fri, 09 Jan 2009 03:26:51 -0600 (CST) Received: from localhost.localdomain (d975xbx2 [127.0.0.1]) by localhost.localdomain (8.14.2/8.14.2) with ESMTP id n099SER0012007; Fri, 09 Jan 2009 04:28:14 -0500 Received: (from lenb@localhost) by localhost.localdomain (8.14.2/8.14.2/Submit) id n099SDWn012006; Fri, 09 Jan 2009 04:28:13 -0500 Date: Fri, 09 Jan 2009 04:26:54 -0500 From: Len Brown Subject: [PATCH 52/94] ACPI: PCI: follow typical PCI INTx swizzling pattern In-reply-to: <1231493256-11678-1-git-send-email-lenb@kernel.org> In-reply-to: To: linux-acpi@vger.kernel.org Cc: Bjorn Helgaas , Len Brown Message-id: Organization: Intel Open Source Technology Center X-Mailer: git-send-email 1.6.1.76.gc123b References: <1231493256-11678-1-git-send-email-lenb@kernel.org> References: Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Bjorn Helgaas No functional change; this just uses the typical pattern of PCI INTx swizzling done on other architectures. Signed-off-by: Bjorn Helgaas Signed-off-by: Len Brown --- drivers/acpi/pci_irq.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index e42481f..b35e64d 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c @@ -399,7 +399,7 @@ static struct acpi_prt_entry * acpi_pci_irq_derive(struct pci_dev *dev, int pin) { struct acpi_prt_entry *entry = NULL; - struct pci_dev *bridge = dev; + struct pci_dev *bridge; u8 bridge_pin = 0, orig_pin = pin; @@ -407,9 +407,9 @@ acpi_pci_irq_derive(struct pci_dev *dev, int pin) * Attempt to derive an IRQ for this device from a parent bridge's * PCI interrupt routing entry (eg. yenta bridge and add-in card bridge). */ - while (bridge->bus->self) { - pin = (((pin - 1) + PCI_SLOT(bridge->devfn)) % 4) + 1; - bridge = bridge->bus->self; + bridge = dev->bus->self; + while (bridge) { + pin = (((pin - 1) + PCI_SLOT(dev->devfn)) % 4) + 1; if ((bridge->class >> 8) == PCI_CLASS_BRIDGE_CARDBUS) { /* PC card has the same IRQ as its cardbridge */ @@ -431,6 +431,9 @@ acpi_pci_irq_derive(struct pci_dev *dev, int pin) pci_name(bridge))); return entry; } + + dev = bridge; + bridge = dev->bus->self; } dev_warn(&dev->dev, "can't derive routing for PCI INT %c\n",