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 (Arm)" X-Patchwork-Id: 10145647 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4BE70605BD for ; Thu, 4 Jan 2018 21:17:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 337B523794 for ; Thu, 4 Jan 2018 21:17:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2812F223C6; Thu, 4 Jan 2018 21:17:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD98228CC3 for ; Thu, 4 Jan 2018 21:13:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753367AbeADVMk (ORCPT ); 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-Google-Smtp-Source: ACJfBotOAkQlNRy1ZL9qzqwEMTbrp+s9py39H0jYY+C3PNFZ8jCIxea7qCQARHp5CwoHf7AB74K46Q== 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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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) {