Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3524426imm; Sun, 14 Oct 2018 22:46:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV627XpuCkYVDQOvtRJl10VAjpJzkBUV+gToGmAzOwpQCwCdlSTKnAiU6kWXOEPIOnSY23Yb5 X-Received: by 2002:a17:902:b907:: with SMTP id bf7-v6mr15963206plb.127.1539582370116; Sun, 14 Oct 2018 22:46:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539582370; cv=none; d=google.com; s=arc-20160816; b=Fe1Jm8ItOCeYD+pCmA98JAnb2lWTgsJw3mUM3BUkfQg1sXJMXBFJP6cS0h/bAsiHl9 jYADQ7QDfTq35xIxPKFfYMXGSFZMBBg+AF17rg5T/VX26oOd9iuTSayhdPjoa2Xr8PB8 gvuxmoOUvK+fr0mYJ1kiIcLNY3RAbRG/8mErWQf/cj9LOyFEBUKY6wwVg8Wav6tJVEyY Uv3RUEd+wAngfpmbXpj76+BYp/nMOHgOAMdjeEGGAruXiQRUdU9g7GF5jB9U5VxQfZxh Ij5MpeN27Bpx/OnwAjcGZMwpLHYZikfL2TLmo/0aW9G6M5cuHB4nSy6El7juVWFLTcr7 PzIQ== 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=CkFZku7XIJ27YaRHtybDiEGUxDYG9Vnbv/2JR+rAfWo=; b=AxWWcMsT7lFh/U9H9UzwXKA1u7AbDW3enYEQujRKYMhszzbdMNtGfmE24SSWCB8eEy B0qH6jSwVYBD4l0dm12a/MYTUG73MNByFWs0ZPCwHdyurcWfFuOe9DscBj8rDgx1wxn+ 4EUQXCAjS20fxo01lGO4SNr+jieszDxyaBGZI4+64Rky+tsxsTQJTDj0mH8koylnyom6 M6v5HW2bdfrtnCD6odik64IpL0M/PH5ii2EfNpZV51R/uLJnUiHCP4T4q1pOq/HOvF7B za/kYE1s2IgOEc16MtVR8gL+8w0YHrHRJS2yPKVeHghVzSi7g2VWbkxR2acdCuxGu7X6 4VcA== 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 k20-v6si9667918pgm.574.2018.10.14.22.45.55; Sun, 14 Oct 2018 22:46:10 -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 S1726976AbeJON2u (ORCPT + 99 others); Mon, 15 Oct 2018 09:28:50 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:15915 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726667AbeJON2u (ORCPT ); Mon, 15 Oct 2018 09:28:50 -0400 X-UUID: a8a49d1024c048c08b9483a95b9b2f35-20181015 X-UUID: a8a49d1024c048c08b9483a95b9b2f35-20181015 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 699156771; Mon, 15 Oct 2018 13:44:55 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 15 Oct 2018 13:44:53 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 15 Oct 2018 13:44:52 +0800 From: To: , , , , , , CC: , , , , , , , , , Subject: [PATCH v7 4/9] PCI: mediatek: Convert to use pci_host_probe() Date: Mon, 15 Oct 2018 13:44:42 +0800 Message-ID: <1539582287-9171-5-git-send-email-honghui.zhang@mediatek.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1539582287-9171-1-git-send-email-honghui.zhang@mediatek.com> References: <1539582287-9171-1-git-send-email-honghui.zhang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 0C1245066352060978BBCC10F29C80A30DBFB5A7362A87711876ABD1A6658F902000: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 --- 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