Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3105327imm; Sun, 7 Oct 2018 20:26:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV60yCrr80tHtpdj42pAKvRAg5+q98YYnvYBhx4xgbWQNKFJSYQ4uxIFnQMn5NyTOCH9Y9Lhk X-Received: by 2002:a63:d0e:: with SMTP id c14-v6mr19298421pgl.281.1538969162798; Sun, 07 Oct 2018 20:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538969162; cv=none; d=google.com; s=arc-20160816; b=lW7fizCAKUhg+lsgb5O1rJ759lcwgtiP2xTlqWEJx8NAmF1xaIGG3s2juR6y0q9tuU O+jniblflgfI+zaJZQTwv38ypK7FQYmagmw3PL6mziKQAbZKQpV2PjGBHcj+iNY7NC6J 26eWYniPzVb5WknBl1eutHYFAAmiS/UDBQEgO5bP+7yLPFkx3Z5savk3pjs8VoqPD+Mz ZRHK4Ww/1lirLZFLc2BI9dixuBPF4bujW1/0FnypdCChNi8rYlC+4kUzxt99KytR7+Lp Uzu/d4kCB+8IfHT8ovqesx5QbXBDiDSmBYzKCNwMhTWwUw3P/Y342izlRhfWkWn/AoBP xuWQ== 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=mK4/U+DVp9hgVbQuLvjdYagL7W8PnfpMsN34J4ELmDcbGZJykwDJ8eurhCbEfjZLsW HviEOq7ArHQbkIeb9AQY6eBMqgcQfhA0mtRGXSUyGsrZX8ymCjBSXjyVD2sfiud+oaR4 4Ty1/lbem4/1GVI23J7Ekf+xwzkHaJ8FKhAbFoSenvubMuOGcb76Ka0AaSFc3d56UTA9 829pcxGlb0Y/eZCetVa2osyyNqo+2EzjcV5Xuif3uFgoe6vFcu4v0mcYowrZK9Dv7zrT mSQXQaSDmy27ZFajaTNVN41sYp9t9A8wmCmvKoiIa3fODxrnKMdhanhUoIJAiUgzIRT1 EsGg== 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 i3-v6si15633719pgm.77.2018.10.07.20.25.47; Sun, 07 Oct 2018 20:26:02 -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 S1727078AbeJHKfC (ORCPT + 99 others); Mon, 8 Oct 2018 06:35:02 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:46639 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726656AbeJHKes (ORCPT ); Mon, 8 Oct 2018 06:34:48 -0400 X-UUID: 0292be4f953f485699435555e8a4cbe0-20181008 X-UUID: 0292be4f953f485699435555e8a4cbe0-20181008 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1108436183; Mon, 08 Oct 2018 11:25:04 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 8 Oct 2018 11:25:02 +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, 8 Oct 2018 11:25:01 +0800 From: To: , , , , , , CC: , , , , , , , , , Subject: [PATCH v6 4/9] PCI: mediatek: Convert to use pci_host_probe() Date: Mon, 8 Oct 2018 11:24:43 +0800 Message-ID: <1538969088-7136-5-git-send-email-honghui.zhang@mediatek.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1538969088-7136-1-git-send-email-honghui.zhang@mediatek.com> References: <1538969088-7136-1-git-send-email-honghui.zhang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 5C3799D707854C0F661CE5E236E103F9A086877C463CDA5AF3DEFE46599E525E2000:8 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