From patchwork Wed Feb 19 10:35:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 24936 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5F4EE201EE for ; Wed, 19 Feb 2014 10:35:52 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id g12sf757023oah.2 for ; Wed, 19 Feb 2014 02:35:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=Vw4Z+yE5yqJpUBwogaCIHZ5XT1wFyTmefsKKiX1LYww=; b=eV9nCUmN//az0gLKm6rY7ulZ3cPKdC5GLfiVsp+MkJrTcjUG7fb79wbza1bW9RKFVb /pn0BgLzC0j4fR9OytPVqXrQcUBXvIf3Wqv5psFaysDK0pEvZohOXNkKlBzq6xp0NSoG bk1pALVP5iyZJthKIPOZsZffoc2NhRdEb2AvF4r/shFaWC0odPSSAqM8QE7TuiecjHmC D28fbd/0S/JjByyzmt+tqaIbqDUBVij/WAMY3dY+Y+YTWnrTHSNK2b1p9ieKH5r6uxzZ Mi1jjhajfPtI2WLF6Los9Ivdp7zCEFbTp0hJyruBCqEhtvcmParLXjx+8oAPeD7gKLNj 0EUQ== X-Gm-Message-State: ALoCoQkjbd1UWE37TtnRGGgGunV+Vo1RqmVdFBr2JDWAf8jYNrnuyBPXg+jnEArkHrLlGvxJZJyk X-Received: by 10.42.98.81 with SMTP id r17mr12766408icn.8.1392806151070; Wed, 19 Feb 2014 02:35:51 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.83.73 with SMTP id i67ls50838qgd.97.gmail; Wed, 19 Feb 2014 02:35:50 -0800 (PST) X-Received: by 10.52.106.166 with SMTP id gv6mr23502vdb.86.1392806150901; Wed, 19 Feb 2014 02:35:50 -0800 (PST) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id b20si2393908veu.30.2014.02.19.02.35.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Feb 2014 02:35:50 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id hq11so179830vcb.14 for ; Wed, 19 Feb 2014 02:35:50 -0800 (PST) X-Received: by 10.220.191.134 with SMTP id dm6mr25221671vcb.16.1392806150830; Wed, 19 Feb 2014 02:35:50 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp286862vcz; Wed, 19 Feb 2014 02:35:50 -0800 (PST) X-Received: by 10.66.145.199 with SMTP id sw7mr1367950pab.143.1392806150049; Wed, 19 Feb 2014 02:35:50 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yn1si8719439pab.139.2014.02.19.02.35.49; Wed, 19 Feb 2014 02:35:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752708AbaBSKfr (ORCPT + 8 others); Wed, 19 Feb 2014 05:35:47 -0500 Received: from mail-ee0-f44.google.com ([74.125.83.44]:33228 "EHLO mail-ee0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751825AbaBSKfq (ORCPT ); Wed, 19 Feb 2014 05:35:46 -0500 Received: by mail-ee0-f44.google.com with SMTP id c13so126226eek.17 for ; Wed, 19 Feb 2014 02:35:43 -0800 (PST) X-Received: by 10.14.29.6 with SMTP id h6mr2488998eea.84.1392806143734; Wed, 19 Feb 2014 02:35:43 -0800 (PST) Received: from tn-HP3-PC.semihalf.com ([80.82.22.190]) by mx.google.com with ESMTPSA id o43sm81524962eef.12.2014.02.19.02.35.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Feb 2014 02:35:42 -0800 (PST) From: Tomasz Nowicki To: lenb@kernel.org, rjw@rjwysocki.net Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-acpi@lists.linaro.org, Tomasz Nowicki Subject: [PATCH v2 1/1] ACPI, PCI, ISA: Call ISA-specific code only for architectures which support ISA. Date: Wed, 19 Feb 2014 11:35:22 +0100 Message-Id: <1392806122-23318-1-git-send-email-tomasz.nowicki@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-acpi-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: tomasz.nowicki@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This commit moves ISA-specific code to separate function and makes that function depend on CONFIG_{E}ISA so that we do not have to maintain acpi_isa_irq_to_gsi() function for architectures which do not support ISA. Signed-off-by: Tomasz Nowicki --- drivers/acpi/pci_irq.c | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 361b40c..0a553a0 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c @@ -370,6 +370,30 @@ static struct acpi_prt_entry *acpi_pci_irq_lookup(struct pci_dev *dev, int pin) return NULL; } +#if IS_ENABLED(CONFIG_ISA) || IS_ENABLED(CONFIG_EISA) +static int acpi_isa_register_gsi(struct pci_dev *dev) +{ + u32 dev_gsi; + + /* Interrupt Line values above 0xF are forbidden */ + if (dev->irq > 0 && (dev->irq <= 0xF) && + (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) { + dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n", + pin_name(dev->pin), dev->irq); + acpi_register_gsi(&dev->dev, dev_gsi, + ACPI_LEVEL_SENSITIVE, + ACPI_ACTIVE_LOW); + return 0; + } + return -EINVAL; +} +#else +static inline int acpi_isa_register_gsi(struct pci_dev *dev) +{ + return -ENODEV; +} +#endif + int acpi_pci_irq_enable(struct pci_dev *dev) { struct acpi_prt_entry *entry; @@ -416,16 +440,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev) * driver reported one, then use it. Exit in any case. */ if (gsi < 0) { - u32 dev_gsi; - /* Interrupt Line values above 0xF are forbidden */ - if (dev->irq > 0 && (dev->irq <= 0xF) && - (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) { - dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n", - pin_name(pin), dev->irq); - acpi_register_gsi(&dev->dev, dev_gsi, - ACPI_LEVEL_SENSITIVE, - ACPI_ACTIVE_LOW); - } else { + if (acpi_isa_register_gsi(dev)) { dev_warn(&dev->dev, "PCI INT %c: no GSI\n", pin_name(pin)); }