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: 855823 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zCLHj6rWJz9s7n for ; Fri, 5 Jan 2018 08:18:09 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zCLHj5tnszDqg9 for ; Fri, 5 Jan 2018 08:18:09 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=74.125.82.195; helo=mail-ot0-f195.google.com; envelope-from=robherring2@gmail.com; receiver=) Received: from mail-ot0-f195.google.com (mail-ot0-f195.google.com [74.125.82.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zCL9201j2zDqp6 for ; Fri, 5 Jan 2018 08:12:21 +1100 (AEDT) Received: by mail-ot0-f195.google.com with SMTP id v40so2391118ote.13 for ; Thu, 04 Jan 2018 13:12:21 -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=qLcG1k7SyQs4DrNPaHRRI6PLcjY/1ktXjCa2+jN0k33jSkScTywKyLXzpkJgGGMOBs IKG3T4x9deooqj/oEgrKqNSYbLy/7WKEZCqRQgy+MFwPjhsuums/mh2f/RTp1Dq1qqjw 5pHtOTcCpQOm+wlzEIycO7mIpVSRql5nPHr0pY2cOUb3dixK8B74wt547Q8Cbv5IynSv ui/nvhqUR+9nizBdxUtLrpbkUS6okUsz1j3yewGFKNbZKyNHEXIapQFCgBNd1yXCULZ+ QSsBSYU90oZFxes/g7mLwBWoRvi1Wloxf5NFP4O2hDAs+n6Powfs4Loi0kcJzwhNM+Bf Mk7Q== X-Gm-Message-State: AKwxytfkmkD+arLWGIaJZhLX7RRLSfmC5ciJDvmEXcQC/iJopuabbEHQ iNmTX4ncOr5jQZgf3r2Mxw== 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 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> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Mackerras , Frank Rowand Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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) {