From patchwork Thu Feb 20 13:27:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 25055 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f69.google.com (mail-pb0-f69.google.com [209.85.160.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DA92D203BE for ; Thu, 20 Feb 2014 13:28:08 +0000 (UTC) Received: by mail-pb0-f69.google.com with SMTP id md12sf4525610pbc.4 for ; Thu, 20 Feb 2014 05:28:08 -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=MWDa/jzykBw4pVcNFRC6Sjdh/lu4IFu/c5MGrACj75U=; b=PMe6WmOf4CFAdxIYMojAijyTXtSJbxKWlCBDFDEqVYqPfMQcCkygoClVCZf7jiPY5h LrUSSz9SXd6iCRHtvFNPepQ2ogglVg0VanhOek4mP4CRNSCHnyLL+lfJyhCnbSW4lacI VhV1K+69OHfrApcix2gpO6Xs9GOLcjQzMYfcaLdfWIjGtZtNnk7Ji5bAZF9QPOpJ2dYz bm+DYOImV1n5xSN06T0uy0S6cRg+vviv/MrOjGP0/j7j12yktrA5Qbi/o2cvyg8jht/Y 7QvubPNUPW48Etn2R5eOWGvQpu++pUcnuUFESD+nDy4U7Gnaz0pS76OU3sZiT8xhhmIc OVrg== X-Gm-Message-State: ALoCoQnFwjwUx5Kz3hdDEwvOvv5vxdKq6BtMAmCn2TwYVaotzdk4WCXxiTW3EWtGlFQbCgpH7RvN X-Received: by 10.68.201.134 with SMTP id ka6mr741313pbc.4.1392902887926; Thu, 20 Feb 2014 05:28:07 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.41 with SMTP id f38ls498819qge.55.gmail; Thu, 20 Feb 2014 05:28:07 -0800 (PST) X-Received: by 10.221.73.73 with SMTP id yr9mr996007vcb.76.1392902887804; Thu, 20 Feb 2014 05:28:07 -0800 (PST) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id kl10si1448710vdb.51.2014.02.20.05.28.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 05:28:07 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.178 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.178; Received: by mail-vc0-f178.google.com with SMTP id ik5so1820157vcb.23 for ; Thu, 20 Feb 2014 05:28:07 -0800 (PST) X-Received: by 10.52.106.166 with SMTP id gv6mr801929vdb.86.1392902887717; Thu, 20 Feb 2014 05:28:07 -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 u4csp58664vcz; Thu, 20 Feb 2014 05:28:07 -0800 (PST) X-Received: by 10.66.27.72 with SMTP id r8mr2078714pag.62.1392902886657; Thu, 20 Feb 2014 05:28:06 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bo2si3482618pbb.313.2014.02.20.05.28.05; Thu, 20 Feb 2014 05:28:05 -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 S1753944AbaBTN2E (ORCPT + 8 others); Thu, 20 Feb 2014 08:28:04 -0500 Received: from mail-ea0-f172.google.com ([209.85.215.172]:59674 "EHLO mail-ea0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753915AbaBTN2D (ORCPT ); Thu, 20 Feb 2014 08:28:03 -0500 Received: by mail-ea0-f172.google.com with SMTP id l9so923517eaj.3 for ; Thu, 20 Feb 2014 05:28:01 -0800 (PST) X-Received: by 10.14.103.134 with SMTP id f6mr1869498eeg.41.1392902881197; Thu, 20 Feb 2014 05:28:01 -0800 (PST) Received: from tn-HP3-PC.semihalf.com ([80.82.22.190]) by mx.google.com with ESMTPSA id v6sm13839690eef.2.2014.02.20.05.27.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 05:28:00 -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 v3 1/1] ACPI, PCI, ISA: Call ISA-specific code only for architectures which support ISA. Date: Thu, 20 Feb 2014 14:27:46 +0100 Message-Id: <1392902866-5256-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.178 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 | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 361b40c..9c62340 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,19 +440,9 @@ 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)); - } kfree(entry); return 0;