Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3631096imm; Mon, 15 Oct 2018 01:11:14 -0700 (PDT) X-Google-Smtp-Source: ACcGV62No/ox/L7c0IlwaKXe/Wsj5qouBSivf9HwKs20GcaAB+gmq5UrN/O8gBUc/H2fwSnGRP4w X-Received: by 2002:a63:d556:: with SMTP id v22-v6mr14473146pgi.357.1539591074852; Mon, 15 Oct 2018 01:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539591074; cv=none; d=google.com; s=arc-20160816; b=Wb/1mDfa21c1NVXhq5Q+JXaZ565Ku1N7WGO0iHirJYAX/MPu/89/1Rg1DOMIAZpygi ceNlQb+c6Gy2Jqa/V90BHU03UvLxdOpFzbdCgkiKsLWVwhy/YDcJZN5yEpxRbs/ExU7L Q9iO/6P1CN0KLdLhA4d5N33oLHH2khfSzyqeuhjqi1lKWHvWume3Vl2XDDuhJtbTk6Fm N9GJpixMfX17JDEeEilfKS5a1qNpoJc5SDM8WFLB+rtpKvMcG4TVdDpWQtE49xcQHj8K H64X69Jqq9qr79+f0wFZH9LpnNw9B/fPe1W/1R+/WYOxjXsFWpEwOA2XrJWkazWrxQR9 hTMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=E81jbpNHl6FTi/12bIoiIS/bmMrcN9oAM+Fd1qQmq5Y=; b=eUaZaZqBIWHiL19GD6yY13/OmTJLtrU7Wh2AoxlltEwWz40buGtF9Yih6/ArJtJfs0 pENLvTVEOymUjKoDIBX0+n1jhIy94vsERPfe2lvVFLnxPjtlrhIec0h6vGQ+cDqo96Nl gMwXAO8nOX2vP9Z3Smpv+ji1f+lTxyhHc8ev1WJsHrj+d4RnvLsUytMciMivaVyFHHMM r+kFkbjrCASZXZIJduCYubyqSAcN79Ajd+q8i46/LS7mnF1zmGFmBh0zjyJjTtSnPuCm IMkQqwXnE+ffjza9q4pLaiZh6PhUXu2VTOCEjuO75x+w1OAnA7lKOGp+IlNJ1s6Iz3/r 3guw== 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 w71-v6si9509788pgd.163.2018.10.15.01.11.00; Mon, 15 Oct 2018 01:11:14 -0700 (PDT) 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 S1726775AbeJOPxY (ORCPT + 99 others); Mon, 15 Oct 2018 11:53:24 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:29027 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726541AbeJOPxX (ORCPT ); Mon, 15 Oct 2018 11:53:23 -0400 X-UUID: 15926b91fbfe4a8a98d3a4d8689170e6-20181015 X-UUID: 15926b91fbfe4a8a98d3a4d8689170e6-20181015 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1728988825; Mon, 15 Oct 2018 16:09:08 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 15 Oct 2018 16:09:07 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 15 Oct 2018 16:09:05 +0800 From: To: , , , , , , CC: , , , , , , , , , , Subject: [PATCH v8 4/9] PCI: mediatek: Convert to use pci_host_probe() Date: Mon, 15 Oct 2018 16:08:55 +0800 Message-ID: <1539590940-13355-5-git-send-email-honghui.zhang@mediatek.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1539590940-13355-1-git-send-email-honghui.zhang@mediatek.com> References: <1539590940-13355-1-git-send-email-honghui.zhang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Honghui Zhang Part of mtk_pcie_register_host is an open-coded version of pci_host_probe(). So instead of duplicating this code, use pci_host_probe() directly and remove mtk_pcie_register_host. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 37 ++++++++-------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c index 59fdb60..ead6005 100644 --- a/drivers/pci/controller/pcie-mediatek.c +++ b/drivers/pci/controller/pcie-mediatek.c @@ -1121,34 +1121,6 @@ static int mtk_pcie_request_resources(struct mtk_pcie *pcie) return 0; } -static int mtk_pcie_register_host(struct pci_host_bridge *host) -{ - struct mtk_pcie *pcie = pci_host_bridge_priv(host); - struct pci_bus *child; - int err; - - host->busnr = pcie->busn.start; - host->dev.parent = pcie->dev; - host->ops = pcie->soc->ops; - host->map_irq = of_irq_parse_and_map_pci; - host->swizzle_irq = pci_common_swizzle; - host->sysdata = pcie; - - err = pci_scan_root_bus_bridge(host); - if (err < 0) - return err; - - pci_bus_size_bridges(host->bus); - pci_bus_assign_resources(host->bus); - - list_for_each_entry(child, &host->bus->children, node) - pcie_bus_configure_settings(child); - - pci_bus_add_devices(host->bus); - - return 0; -} - static int mtk_pcie_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -1175,7 +1147,14 @@ static int mtk_pcie_probe(struct platform_device *pdev) if (err) goto put_resources; - err = mtk_pcie_register_host(host); + host->busnr = pcie->busn.start; + host->dev.parent = pcie->dev; + host->ops = pcie->soc->ops; + host->map_irq = of_irq_parse_and_map_pci; + host->swizzle_irq = pci_common_swizzle; + host->sysdata = pcie; + + err = pci_host_probe(host); if (err) goto put_resources; -- 2.6.4