From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C287DC433DF for ; Fri, 22 May 2020 23:48:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D26E2073B for ; Fri, 22 May 2020 23:48:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590191329; bh=Zhl4XysZK1bu8mUt0nvN7h39mpBRdUu1dXzys3pZY6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZHix+okWeCzd1QtWjUZW/Tm8PKtXd948S8NqiJKpSyFtdV6JzjhLZZw2UyIxq3ge5 53F34iTzU4jBaCDSHsrYmDxPXCrHnZhMUDYe0n+zwvmE8GhCcnkQVBgo+yN0/iuXob AKiqmuawX8GoCUTni1oy6jEy8LFm98Y4IMyv+Qas= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387435AbgEVXst (ORCPT ); Fri, 22 May 2020 19:48:49 -0400 Received: from mail-il1-f195.google.com ([209.85.166.195]:46922 "EHLO mail-il1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387413AbgEVXss (ORCPT ); Fri, 22 May 2020 19:48:48 -0400 Received: by mail-il1-f195.google.com with SMTP id w18so12437147ilm.13 for ; Fri, 22 May 2020 16:48:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zH2C4ImO8nBnvyYQO4O7Y0tt8wrJ36q82CPBc6+58Gs=; b=Kqg1cHr7p6LLh9wS6F5EjscfBMwhEmHKsEyyWZeS3mkMqB/AJCmAnaUCOUYCXwRaW1 u8hL8w9TtSEufsdtB8jxDAW/vUWxvQRD4uyworVVZKDDUHr5GWvTWGBx5Hun7UC/i3pU yWLLehIrzOj+DT3sXDruaqp42RBhpwipLP79w6niX89ZcWa/bg+nuP30O8TIVbYxMWJz GVvCMMTlMJgsZIFMZqi1HOUmOVMvn0lKFSEt5CpFunc+P0lDNubRFEli3q94Fxqgduyt p4eE80WTdxuDGSlxZFxnVOalkteVr4W/q1uC3YXUIriBgxEOaeZnrv5Z/Rr8cRvCuPPm Ds3A== X-Gm-Message-State: AOAM530IaFCKpcnJlCFauAyaKJXXQtKid3y8BmSk5/yEydHc06VnJTz5 gn310Rlzxoqr+cC6Uwe28g== X-Google-Smtp-Source: ABdhPJybuB2O9NZz3pehcS6OOH6aSsjmBYbiZ8trb6adP3sKcXHHx5eDTRdxXxjc/F2eV1Dz4MmC9g== X-Received: by 2002:a92:c94f:: with SMTP id i15mr14637382ilq.185.1590191327879; Fri, 22 May 2020 16:48:47 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:47 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Shawn Lin , Heiko Stuebner , linux-rockchip@lists.infradead.org Subject: [PATCH 13/15] PCI: rockchip: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:30 -0600 Message-Id: <20200522234832.954484-14-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The rockchip host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. Cc: Shawn Lin Cc: Heiko Stuebner Cc: linux-rockchip@lists.infradead.org Signed-off-by: Rob Herring --- drivers/pci/controller/pcie-rockchip-host.c | 18 ++++-------------- drivers/pci/controller/pcie-rockchip.h | 1 - 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/controller/pcie-rockchip-host.c index 94af6f5828a3..6a3c8442258b 100644 --- a/drivers/pci/controller/pcie-rockchip-host.c +++ b/drivers/pci/controller/pcie-rockchip-host.c @@ -949,7 +949,6 @@ static int rockchip_pcie_probe(struct platform_device *pdev) { struct rockchip_pcie *rockchip; struct device *dev = &pdev->dev; - struct pci_bus *bus, *child; struct pci_host_bridge *bridge; struct resource *bus_res; int err; @@ -1015,20 +1014,10 @@ static int rockchip_pcie_probe(struct platform_device *pdev) bridge->map_irq = of_irq_parse_and_map_pci; bridge->swizzle_irq = pci_common_swizzle; - err = pci_scan_root_bus_bridge(bridge); + err = pci_host_probe(bridge); if (err < 0) goto err_remove_irq_domain; - bus = bridge->bus; - - rockchip->root_bus = bus; - - pci_bus_size_bridges(bus); - pci_bus_assign_resources(bus); - list_for_each_entry(child, &bus->children, node) - pcie_bus_configure_settings(child); - - pci_bus_add_devices(bus); return 0; err_remove_irq_domain: @@ -1051,9 +1040,10 @@ static int rockchip_pcie_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct rockchip_pcie *rockchip = dev_get_drvdata(dev); + struct pci_host_bridge *bridge = pci_host_bridge_from_priv(rockchip); - pci_stop_root_bus(rockchip->root_bus); - pci_remove_root_bus(rockchip->root_bus); + pci_stop_root_bus(bridge->bus); + pci_remove_root_bus(bridge->bus); irq_domain_remove(rockchip->irq_domain); rockchip_pcie_deinit_phys(rockchip); diff --git a/drivers/pci/controller/pcie-rockchip.h b/drivers/pci/controller/pcie-rockchip.h index d90dfb354573..4012543bafbe 100644 --- a/drivers/pci/controller/pcie-rockchip.h +++ b/drivers/pci/controller/pcie-rockchip.h @@ -303,7 +303,6 @@ struct rockchip_pcie { struct device *dev; struct irq_domain *irq_domain; int offset; - struct pci_bus *root_bus; void __iomem *msg_region; phys_addr_t msg_bus_addr; bool is_rc; -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E67EEC433DF for ; Fri, 22 May 2020 23:53:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8BF5A20738 for ; Fri, 22 May 2020 23:53:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TKA0iKsL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BF5A20738 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pmrION8elVm/nCNrM0bmZvmbj4cxsy4Hu/DhV9rKkEc=; b=TKA0iKsLvzeZZp t6cd6SnTLUKDUfvL1ZesreBBzHvBlEuhKJHwBAEprgyFFPm/7/MQXdaoIWFVRXCNZT/Gm5y72xLpT znBFGwhcNBufcCpvRHtNxRu/7FuxsLtPd8Nhkbny+P+OK1X+FnBv9i7kRm20RIyw/0W5m0Lr6fbA7 ZSUU872RhKU+3LenfruEMrmM6NzCbWZP22ts22YkI1HniFsA4n/hylEDUFDRIo6Yj546k03ew3FUA 7dSY8HByeIMRizubWf+XiZctlkkJXW7oH251e6+NRAk58GX0u78JoXFbGaharkK6XhyztBzAiOfvf TST/eJtsCgm8u8Ls89IA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jcHTL-0000k9-UE; Fri, 22 May 2020 23:53:03 +0000 Received: from mail-il1-f195.google.com ([209.85.166.195]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jcHPG-0003ZV-1f; Fri, 22 May 2020 23:48:52 +0000 Received: by mail-il1-f195.google.com with SMTP id 4so12533537ilg.1; Fri, 22 May 2020 16:48:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zH2C4ImO8nBnvyYQO4O7Y0tt8wrJ36q82CPBc6+58Gs=; b=iP7/Z03t/v6yn3bkrJE+7nmpL71uBKUP+0jZbJhpnp6gqJb6ASL/jktvzWUzsn2AYd cQidnR0bA8MT2r4kzU60PocZMmAdu6nBnWm4Bdeg6wEG0Rf74/2uZ5xkpLN5RZebPuc+ DBYua2Ohv3xYfpLkKJPWaVF3qBmke7zf8UIlEZKp5mh9kaJS0wBgwQu6/i5+mdSE/2/s jioM+iblxy36H5ArAsAnEQIKmIH2Zs4x2YXfLdb9qiNFs6ME9h80okqFtK+Ry7N6peTv wpadakcghMFr71xD8qFQh3g9NJoqe/Ng3HpyGhdxpYHXUkJ5i8Zuu7CbhbEnHREPW4Y2 W/sA== X-Gm-Message-State: AOAM533Nh1AH6DfuWfWS5JcLonsa/fYn28nRWx29QRXN7L3QQDnkt+YR INNf00DRtZvM1SAn7bfM+lcq73g= X-Google-Smtp-Source: ABdhPJybuB2O9NZz3pehcS6OOH6aSsjmBYbiZ8trb6adP3sKcXHHx5eDTRdxXxjc/F2eV1Dz4MmC9g== X-Received: by 2002:a92:c94f:: with SMTP id i15mr14637382ilq.185.1590191327879; Fri, 22 May 2020 16:48:47 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id w23sm4390877iod.9.2020.05.22.16.48.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:47 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Subject: [PATCH 13/15] PCI: rockchip: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:30 -0600 Message-Id: <20200522234832.954484-14-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200522234832.954484-1-robh@kernel.org> References: <20200522234832.954484-1-robh@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200522_164850_354291_85D5606F X-CRM114-Status: GOOD ( 11.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , linux-pci@vger.kernel.org, Shawn Lin , linux-rockchip@lists.infradead.org, Bjorn Helgaas , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org The rockchip host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. Cc: Shawn Lin Cc: Heiko Stuebner Cc: linux-rockchip@lists.infradead.org Signed-off-by: Rob Herring --- drivers/pci/controller/pcie-rockchip-host.c | 18 ++++-------------- drivers/pci/controller/pcie-rockchip.h | 1 - 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/controller/pcie-rockchip-host.c index 94af6f5828a3..6a3c8442258b 100644 --- a/drivers/pci/controller/pcie-rockchip-host.c +++ b/drivers/pci/controller/pcie-rockchip-host.c @@ -949,7 +949,6 @@ static int rockchip_pcie_probe(struct platform_device *pdev) { struct rockchip_pcie *rockchip; struct device *dev = &pdev->dev; - struct pci_bus *bus, *child; struct pci_host_bridge *bridge; struct resource *bus_res; int err; @@ -1015,20 +1014,10 @@ static int rockchip_pcie_probe(struct platform_device *pdev) bridge->map_irq = of_irq_parse_and_map_pci; bridge->swizzle_irq = pci_common_swizzle; - err = pci_scan_root_bus_bridge(bridge); + err = pci_host_probe(bridge); if (err < 0) goto err_remove_irq_domain; - bus = bridge->bus; - - rockchip->root_bus = bus; - - pci_bus_size_bridges(bus); - pci_bus_assign_resources(bus); - list_for_each_entry(child, &bus->children, node) - pcie_bus_configure_settings(child); - - pci_bus_add_devices(bus); return 0; err_remove_irq_domain: @@ -1051,9 +1040,10 @@ static int rockchip_pcie_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct rockchip_pcie *rockchip = dev_get_drvdata(dev); + struct pci_host_bridge *bridge = pci_host_bridge_from_priv(rockchip); - pci_stop_root_bus(rockchip->root_bus); - pci_remove_root_bus(rockchip->root_bus); + pci_stop_root_bus(bridge->bus); + pci_remove_root_bus(bridge->bus); irq_domain_remove(rockchip->irq_domain); rockchip_pcie_deinit_phys(rockchip); diff --git a/drivers/pci/controller/pcie-rockchip.h b/drivers/pci/controller/pcie-rockchip.h index d90dfb354573..4012543bafbe 100644 --- a/drivers/pci/controller/pcie-rockchip.h +++ b/drivers/pci/controller/pcie-rockchip.h @@ -303,7 +303,6 @@ struct rockchip_pcie { struct device *dev; struct irq_domain *irq_domain; int offset; - struct pci_bus *root_bus; void __iomem *msg_region; phys_addr_t msg_bus_addr; bool is_rc; -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel