From patchwork Tue May 12 21:23:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 6391481 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2E42CBEEE1 for ; Tue, 12 May 2015 21:27:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 636A520211 for ; Tue, 12 May 2015 21:27:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78CEE2020F for ; Tue, 12 May 2015 21:27:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YsHgI-0005ct-Er; Tue, 12 May 2015 21:25:38 +0000 Received: from hauke-m.de ([2001:41d0:8:b27b::1]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YsHgA-0003hn-4G for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2015 21:25:31 +0000 Received: from hauke-desktop.fritz.box (p508B67D7.dip0.t-ipconnect.de [80.139.103.215]) by hauke-m.de (Postfix) with ESMTPSA id D9A0D201EA; Tue, 12 May 2015 23:23:05 +0200 (CEST) From: Hauke Mehrtens To: rjui@broadcom.com, bhelgaas@google.com, arnd@arndb.de Subject: [PATCH 1/2] PCI: iproc: make of_irq_parse_and_map_pci() configurable Date: Tue, 12 May 2015 23:23:00 +0200 Message-Id: <1431465781-10753-2-git-send-email-hauke@hauke-m.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431465781-10753-1-git-send-email-hauke@hauke-m.de> References: <1431465781-10753-1-git-send-email-hauke@hauke-m.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150512_142530_367229_5BCDF48D X-CRM114-Status: GOOD ( 11.40 ) X-Spam-Score: -0.0 (/) Cc: sbranden@broadcom.com, linux-pci@vger.kernel.org, zajec5@gmail.com, bcm-kernel-feedback-list@broadcom.com, Hauke Mehrtens , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch makes the generic code not use the function of_irq_parse_and_map_pci() always to get the irqs, but to take a function the actual driver has provided. This is needed to make this function work with drivers not using device tree. Signed-off-by: Hauke Mehrtens Reviewed-by: Ray Jui --- drivers/pci/host/pcie-iproc-platform.c | 2 ++ drivers/pci/host/pcie-iproc.c | 2 +- drivers/pci/host/pcie-iproc.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/pci/host/pcie-iproc-platform.c b/drivers/pci/host/pcie-iproc-platform.c index afad6c2..c8aa06f 100644 --- a/drivers/pci/host/pcie-iproc-platform.c +++ b/drivers/pci/host/pcie-iproc-platform.c @@ -71,6 +71,8 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev) pcie->resources = &res; + pcie->map_irq = of_irq_parse_and_map_pci; + ret = iproc_pcie_setup(pcie); if (ret) { dev_err(pcie->dev, "PCIe controller setup failed\n"); diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c index 329e1b5..cef31f6 100644 --- a/drivers/pci/host/pcie-iproc.c +++ b/drivers/pci/host/pcie-iproc.c @@ -229,7 +229,7 @@ int iproc_pcie_setup(struct iproc_pcie *pcie) pci_scan_child_bus(bus); pci_assign_unassigned_bus_resources(bus); - pci_fixup_irqs(pci_common_swizzle, of_irq_parse_and_map_pci); + pci_fixup_irqs(pci_common_swizzle, pcie->map_irq); pci_bus_add_devices(bus); return 0; diff --git a/drivers/pci/host/pcie-iproc.h b/drivers/pci/host/pcie-iproc.h index e28075e..a333d4b 100644 --- a/drivers/pci/host/pcie-iproc.h +++ b/drivers/pci/host/pcie-iproc.h @@ -34,6 +34,7 @@ struct iproc_pcie { struct pci_bus *root_bus; struct phy *phy; int irqs[IPROC_PCIE_MAX_NUM_IRQS]; + int (*map_irq)(const struct pci_dev *, u8, u8); }; int iproc_pcie_setup(struct iproc_pcie *pcie);