From patchwork Thu Jan 4 21:12:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 123455 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp6qgn; Thu, 4 Jan 2018 13:13:01 -0800 (PST) X-Google-Smtp-Source: ACJfBosyLs1KMom2mK+JbR9bXaBw4s3WcQAlvAbLsAs98VHHBWYFHRtMHI3jai9FIfK3q82Lsgwp X-Received: by 10.99.169.10 with SMTP id u10mr663209pge.162.1515100377746; Thu, 04 Jan 2018 13:12:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515100377; cv=none; d=google.com; s=arc-20160816; b=DVXer7BHtJAzVC5QUYyBCYKfAqReRDelb95ifzFzCCmijnfeIf2Icp+OuUiANaV9wa lafxQjIm3h1SeKXdXNiF17k8AHEtDJWbMq5X7NyFgT6EwHyVsuALgSn3vwGkG70SwbFl bVIBj8HhjuqE8bv9yOgGq4lxdxXZ7L6/LFLjzk8XMlAxkP8miN93sIW/poubjN1qovlF dMWXGp4rzmPhGurZhxe/kdqt6W8A48bTJ8o6BHPCKn7NKeYEeFYgO3fxpdFMpTI2KC4u ToTx30T6Uh/IYdNhTTfJB4SCrbGSpGCK6H9mn8e8NRmeuwUna4ULm3F/DnEIGPAswm4E Bewg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=5xJ3K0gohjOfFSvjeagvtwaj119t9BV2WhDGn6s5KRU=; b=i4WmTYCImJrOmi0E7jIPuUOZo3ANjOkwBJZYSDv344El8Yqhk0HZLkIyJ29RDVrldd 0oyRcprTZaEdr+IO2OXYolzr5OrQgX3WIVW9zz0Rhowm3R3vcK5M8AGZXLDA42axkq7w vR93sDVFXBnb+Sw44B+ni42WpiL+N5Lb4zjJH8q2226pXhQYj4qdEVlkgKtp6WtWbQas PYs4htRUQDhHZTcIwFgFe17026gyzrfHhZaRNhHDQvhfyztsXiguhM40bYHH/s5iUKe3 gb/dGGb8m3FnsjqQk2Pw6RSidvTjMD13kkPO1vTXFS4kFpZDnCu+8U+aFd40kt27/ADR QC2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s77si2901407pfa.172.2018.01.04.13.12.57; Thu, 04 Jan 2018 13:12:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753385AbeADVMk (ORCPT + 10 others); Thu, 4 Jan 2018 16:12:40 -0500 Received: from mail-ot0-f195.google.com ([74.125.82.195]:46039 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753269AbeADVMU (ORCPT ); Thu, 4 Jan 2018 16:12:20 -0500 Received: by mail-ot0-f195.google.com with SMTP id o1so2395118oti.12; Thu, 04 Jan 2018 13:12:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5xJ3K0gohjOfFSvjeagvtwaj119t9BV2WhDGn6s5KRU=; b=gkOOb3fYfYY+oQWHn25asO+zoCF9XtIksEUvgS+OYKXl3QxcO9tiyZIQT44vC55fbb a9HKyS8BgZBnWvaeyAGkqRva2MjDtV7cOpNqc3AGTK7d9fLfwCNfriW7y7awdCwu+VYb tXGTd1+W/df6F3DwwpIFEBVGDbYOCgtyoa3om2Zmkvx+9tcH7qbo28WiVgOiWg0rmlCf SH46KVaVJKnsubMP/Mi0xJLe2bdHcwyX4YU35ep3Of4shwEnELwN71ASLKL0BONp2eg4 ki3VGbqNLhS9ZNLp0hblhxZl4WDXuX3NP1BjCbMw/Ezyc2WgT+vclos0rgFz/bdzyyHd 377g== X-Gm-Message-State: AKwxytcT1dh/xwDsLeSrjobiY5BjxOzbI7W++7tA32wwGniLdo48Mzui P4gBaJorDVssKvB7gGFaCA== X-Received: by 10.157.35.26 with SMTP id j26mr584520otb.220.1515100340090; Thu, 04 Jan 2018 13:12:20 -0800 (PST) Received: from xps15.usacommunications.tv (216-188-254-6.dyn.grandenetworks.net. [216.188.254.6]) by smtp.googlemail.com with ESMTPSA id s11sm1988147ots.46.2018.01.04.13.12.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jan 2018 13:12:19 -0800 (PST) From: Rob Herring To: Bjorn Helgaas Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Frank Rowand , linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org Subject: [PATCH 2/3] powerpc/pci: use of_irq_parse_and_map_pci helper Date: Thu, 4 Jan 2018 15:12:14 -0600 Message-Id: <20180104211215.11344-3-robh@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180104211215.11344-1-robh@kernel.org> References: <20180104211215.11344-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of calling both of_irq_parse_pci and irq_create_of_mapping, call of_irq_parse_and_map_pci instead which does the same thing. This will allow making of_irq_parse_pci a private, static function. This changes the logic slightly in that the fallback path will also be taken if irq_create_of_mapping fails internally. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring --- arch/powerpc/kernel/pci-common.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) -- 2.14.1 diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 0ac7aa346c69..f65c07dec23e 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -339,7 +339,6 @@ struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node) */ static int pci_read_irq_line(struct pci_dev *pci_dev) { - struct of_phandle_args oirq; unsigned int virq; pr_debug("PCI: Try to map irq for %s...\n", pci_name(pci_dev)); @@ -348,7 +347,7 @@ static int pci_read_irq_line(struct pci_dev *pci_dev) memset(&oirq, 0xff, sizeof(oirq)); #endif /* Try to get a mapping from the device-tree */ - if (of_irq_parse_pci(pci_dev, &oirq)) { + if (!of_irq_parse_and_map_pci(pci_dev, 0, 0)) { u8 line, pin; /* If that fails, lets fallback to what is in the config @@ -372,11 +371,6 @@ static int pci_read_irq_line(struct pci_dev *pci_dev) virq = irq_create_mapping(NULL, line); if (virq) irq_set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); - } else { - pr_debug(" Got one, spec %d cells (0x%08x 0x%08x...) on %pOF\n", - oirq.args_count, oirq.args[0], oirq.args[1], oirq.np); - - virq = irq_create_of_mapping(&oirq); } if (!virq) {