Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5003975imm; Tue, 16 Oct 2018 03:45:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV62hUPWwKVuZUH+3UZ6obWOfvO8lzGYHEuD8gZ4kB3X87ePAftdDDHQCzFg6t1DneatxgK/C X-Received: by 2002:a63:31c8:: with SMTP id x191-v6mr18999561pgx.229.1539686749947; Tue, 16 Oct 2018 03:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539686749; cv=none; d=google.com; s=arc-20160816; b=q97hjJRfOMAM2ohIR+0Py1JAtpiZsVKMCDmdMfsrfwDcE4QnYKUc9paKP/kfk5rpJP lT7/PmqtoJsrvNU6CM3Vuo7L9XlfE7J1HZ35UO3ycecsL3hx05J1cElQVAU5Yr3/KXSx xe6yRHSn28oDsKalg31LtyqLry5cPP4jc0LFH4iWfyBAdKE9sQR8ewRCnSjAPNaPeheY O7bUv4ZCfc/NwzIVz75p4zpR14ND3qWzsjbO49n/kkZfJ9AWvWBTSh8cep9xksA3Whm0 +cyd4/rYYfPQHyogFPpIE2dRMfgQ3aJaB/WuANqUMWZCEUCQbI3XvoqI6os8xjapvxDn FqGg== 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=Ktn4/98mmtSDlYjyln0XFG+NPx4EHac5enQ8pTRNKZA=; b=zvblvPDGeaLtkGxpLvMdMnLswtJE9RyuHhcjgC31X0bg6N0DyP2hLFZEpuk6jm2gTL ybsVEXaVTJsKX1QngqugXL3Kp5ZT26s3QaX4RlzelpeqydU54Z5l9Q3nGQzV9w1rOQTQ PPNrAUrPtVRX1xc0W+6t+YdSdOTkpiymRNbr5MBphjXl/5BhrmgNXM1JFfjuSc5UJosQ SzzqR6rVhPu+2vYGODiPQGENPH6iqxxYy8cbM3ugC9dFT/Hckjp3nFH3l+z01ogd58dz aJRH933ajV3MR4o291MsDb/c8MQS42eB3NxVxfpECzX5ovLNjxHJGBs6w/G8dFMU4U+D mvTw== 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 z9-v6si13473332pgh.213.2018.10.16.03.45.34; Tue, 16 Oct 2018 03:45:49 -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 S1727174AbeJPSey (ORCPT + 99 others); Tue, 16 Oct 2018 14:34:54 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:54051 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727051AbeJPSex (ORCPT ); Tue, 16 Oct 2018 14:34:53 -0400 X-UUID: 37acdab3121c4a26b78c348a3754dc42-20181016 X-UUID: 37acdab3121c4a26b78c348a3754dc42-20181016 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 91992662; Tue, 16 Oct 2018 18:44:57 +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; Tue, 16 Oct 2018 18:44:56 +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; Tue, 16 Oct 2018 18:44:55 +0800 From: To: , , , , , , CC: , , , , , , , , , Subject: [PATCH v9 4/9] PCI: mediatek: Convert to use pci_host_probe() Date: Tue, 16 Oct 2018 18:44:45 +0800 Message-ID: <1539686690-24068-5-git-send-email-honghui.zhang@mediatek.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1539686690-24068-1-git-send-email-honghui.zhang@mediatek.com> References: <1539686690-24068-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 6080b29..9f12b17 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