Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp556880imm; Fri, 28 Sep 2018 03:06:21 -0700 (PDT) X-Google-Smtp-Source: ACcGV63t5HklTIN310zypdOu7UOLnZabBf94aWXNRbVxCbW+L+uwVISQabT3trDJIddm8utlYX8T X-Received: by 2002:a63:dc14:: with SMTP id s20-v6mr14591672pgg.398.1538129181608; Fri, 28 Sep 2018 03:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538129181; cv=none; d=google.com; s=arc-20160816; b=M9JWHhTGqO1fh5pp4/CsE8lRe19Iwl1fBcbl4/qrL45X9WumSiBvp5fV6kZvtznvku XUPdNl56zTzesK/qGI1oknGyEX5ofar1ivhRqywOxT86VUGNiA2z1KAb7DHJvq9xmasH mEDzVuWiIkrx9w4iV5RjxQHw3b0z4qULhuM5ZmX4X7VemKEkesyibWXw3Ua8i83TIJsZ wqXAVxwpqr/JnZnSrTGwD0xq1ef99xic3h/8g/slSyp769jIydMxTYbq8/2F4If1CVKF JzRnt3tRvcnPljV6+g+Hrq7zh7x5hgKFHuA8ZzVkRLkm951VcMOWeaSrVs5n6TRgmkd3 il6A== 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=4uiIxolA/Bs6SKxUY8uD7wxkvyMjhvievcw8i17macE=; b=tQVwxZu6Aux+PsPOml72Qn10gPVgvO2AFzQZierF8MnG/ULdMe/kxcfRP1jlBHp5ic wqAQpeieNC3nDRvRh+Nby4XCYThoegxQ8do9Un6q4yI0An7st+0egT+37LQLXbH7u4Nf mm5OkB487LTuEsvZcL5sPBWQrnbds+xg6mqb1FOdZOwpTpdosqOpKAdIFJJMD/EPpfwK q1icTQrwn+nY81babozIhVU8vXxeOBUBxxkxCcihfWltrY4GgI2hL2aqvjqirAljW/vv 0EpHt5T44I6psk0k9rOMSJ/v3kpNGwv8bDX/fC0rKKklfdNbqfq54nz4RcVNcwOFkcxu kQOg== 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 91-v6si4765535ple.169.2018.09.28.03.06.05; Fri, 28 Sep 2018 03:06:21 -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 S1729324AbeI1Q1w (ORCPT + 99 others); Fri, 28 Sep 2018 12:27:52 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:41966 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729093AbeI1Q1v (ORCPT ); Fri, 28 Sep 2018 12:27:51 -0400 X-UUID: 652c5d42c3ce4d7794454f274c85c0de-20180928 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1020332467; Fri, 28 Sep 2018 18:04:47 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 28 Sep 2018 18:04:46 +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; Fri, 28 Sep 2018 18:04:45 +0800 From: To: , , , , , , CC: , , , , , , , , , Subject: [PATCH v5 4/9] PCI: mediatek: Convert to use pci_host_probe() Date: Fri, 28 Sep 2018 18:04:35 +0800 Message-ID: <1538129080-8206-5-git-send-email-honghui.zhang@mediatek.com> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1538129080-8206-1-git-send-email-honghui.zhang@mediatek.com> References: <1538129080-8206-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 --- 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 e2c4127..cbf4543 100644 --- a/drivers/pci/controller/pcie-mediatek.c +++ b/drivers/pci/controller/pcie-mediatek.c @@ -1125,34 +1125,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; @@ -1179,7 +1151,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