From patchwork Fri Apr 27 08:23:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 10367721 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 BF7F2601D3 for ; Fri, 27 Apr 2018 08:31:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B104F292D4 for ; Fri, 27 Apr 2018 08:31:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5B1329319; Fri, 27 Apr 2018 08:31:10 +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.4 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_WEB autolearn=ham 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 29EC8292D4 for ; Fri, 27 Apr 2018 08:31:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757801AbeD0IbJ (ORCPT ); Fri, 27 Apr 2018 04:31:09 -0400 Received: from lucky1.263xmail.com ([211.157.147.130]:53651 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757798AbeD0IbI (ORCPT ); Fri, 27 Apr 2018 04:31:08 -0400 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.154]) by lucky1.263xmail.com (Postfix) with ESMTP id 4E1C71F5B14; Fri, 27 Apr 2018 16:31:05 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 5B5DB308; Fri, 27 Apr 2018 16:31:04 +0800 (CST) X-IP-DOMAINF: 1 X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: lorenzo.pieralisi@arm.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-SENDER: lintao@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 7126QGSQF8; Fri, 27 Apr 2018 16:31:05 +0800 (CST) From: Shawn Lin To: Lorenzo Pieralisi , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Shawn Lin , Kishon Vijay Abraham I Subject: [PATCH 3/9] PCI: keystone-dw: Use pci_alloc_intx_irqd() helper to get irq domain for INTx Date: Fri, 27 Apr 2018 16:23:11 +0800 Message-Id: <1524817391-239178-1-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1524817322-239028-1-git-send-email-shawn.lin@rock-chips.com> References: <1524817322-239028-1-git-send-email-shawn.lin@rock-chips.com> 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 Just avoid code duplication, but no functional change intended. Cc: Kishon Vijay Abraham I Signed-off-by: Shawn Lin --- drivers/pci/dwc/pci-keystone-dw.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/pci/dwc/pci-keystone-dw.c b/drivers/pci/dwc/pci-keystone-dw.c index 0682213..171198a 100644 --- a/drivers/pci/dwc/pci-keystone-dw.c +++ b/drivers/pci/dwc/pci-keystone-dw.c @@ -470,15 +470,11 @@ int __init ks_dw_pcie_host_init(struct keystone_pcie *ks_pcie, ks_pcie->app = *res; /* Create legacy IRQ domain */ - ks_pcie->legacy_irq_domain = - irq_domain_add_linear(ks_pcie->legacy_intc_np, - PCI_NUM_INTX, + ks_pcie->legacy_irq_domain = pci_alloc_intx_irqd(dev, ks_pcie, false, &ks_dw_pcie_legacy_irq_domain_ops, - NULL); - if (!ks_pcie->legacy_irq_domain) { - dev_err(dev, "Failed to add irq domain for legacy irqs\n"); - return -EINVAL; - } + ks_pcie->legacy_intc_np); + if (IS_ERR(ks_pcie->legacy_irq_domain)) + return PTR_ERR(ks_pcie->legacy_irq_domain); return dw_pcie_host_init(pp); }