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 C9C70C433DF for ; Fri, 22 May 2020 23:48:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A780E20723 for ; Fri, 22 May 2020 23:48:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590191326; bh=QeTsyYJjXXcXnMQ9yMF6w5KXqYY0+ob9BHE466q4mx8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=u9qMrlyHV2DzrVlo8tiyHxRavVWJrQ9EL+njIQdEDko2mVrF/A7HbIlifclRmBnLv bKHiPe/wGhmFBD8iWNUmc/9PZZjDYbSQeSdgVwiB3LgjpNxnRYI+ImL8NNOxIdkKpc y4zFcVh5YHCS/zEoNFVVIEGwQdUOl3sBnO6mi1MU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387412AbgEVXsq (ORCPT ); Fri, 22 May 2020 19:48:46 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:45027 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387413AbgEVXsp (ORCPT ); Fri, 22 May 2020 19:48:45 -0400 Received: by mail-io1-f68.google.com with SMTP id f4so13286573iov.11 for ; Fri, 22 May 2020 16:48:44 -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=A2f+A+UJfY1PJTDNi0NFbPeTlvbbCc37QATxTjmUPVg=; b=Y9KupFWxtqpfaSRNOczCJuVf2El072vmF38hxAvllioQadtOmMC3SAKJ/yc5l2TI0t /ZhSl1kMWlFZAtKJHdXisEJZbUTg080VpoiorEiI3OOA0Mq+VGCBBKpjGJYU9w0X8wf7 0L7uKr1uP0Qx7g2pUeUWH6/hqA944x4kADVUEkdwElvL9qCmFo6dCxTpUy2LKpKL0/rn nLTrO/tHGSEQdhKh0/UJWsEZTd6Bxfy0XXG2khwlbkvua5ZEHZWEe+6VGw8R5w0D/GWM AhJ15k++7HHw/X/ReuSIl5JC43HOQJQ5Eb0H8M4+dIPOVDnhyFpi56XcnMAY/89vRror x/2A== X-Gm-Message-State: AOAM533ZZo0qa5F+z6EtgFxcKNky52Srr6y8c8SL2LkC+dp4R5ionJCd 8ZcQz9pqczDZSYa0Hdunzw== X-Google-Smtp-Source: ABdhPJz0drAdXL8tOrdvka5OuWYdrXyPsukcMKwJDfVFN/ZlnqO01gwrcMTn1syXCMOnmaFNfmE11w== X-Received: by 2002:a5d:9e55:: with SMTP id i21mr3535285ioi.130.1590191324652; Fri, 22 May 2020 16:48:44 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:43 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ley Foon Tan , rfi@lists.rocketboards.org Subject: [PATCH 10/15] PCI: altera: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:27 -0600 Message-Id: <20200522234832.954484-11-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 altera host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. The only difference is pci_assign_unassigned_bus_resources() was called instead of pci_bus_size_bridges() and pci_bus_assign_resources(). This should be the same. Cc: Ley Foon Tan Cc: rfi@lists.rocketboards.org Signed-off-by: Rob Herring --- drivers/pci/controller/pcie-altera.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c index 24cb1c331058..26ac3ad81de0 100644 --- a/drivers/pci/controller/pcie-altera.c +++ b/drivers/pci/controller/pcie-altera.c @@ -773,8 +773,6 @@ static int altera_pcie_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct altera_pcie *pcie; - struct pci_bus *bus; - struct pci_bus *child; struct pci_host_bridge *bridge; int ret; const struct of_device_id *match; @@ -825,20 +823,7 @@ static int altera_pcie_probe(struct platform_device *pdev) bridge->map_irq = of_irq_parse_and_map_pci; bridge->swizzle_irq = pci_common_swizzle; - ret = pci_scan_root_bus_bridge(bridge); - if (ret < 0) - return ret; - - bus = bridge->bus; - - pci_assign_unassigned_bus_resources(bus); - - /* Configure PCI Express setting. */ - list_for_each_entry(child, &bus->children, node) - pcie_bus_configure_settings(child); - - pci_bus_add_devices(bus); - return ret; + return pci_host_probe(bridge); } static int altera_pcie_remove(struct platform_device *pdev) -- 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=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 274F0C433E0 for ; Fri, 22 May 2020 23:52:39 +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 DFDA9206BE for ; Fri, 22 May 2020 23:52:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZoaeU0Iq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFDA9206BE 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=bRxCHZnqkYKNda01btbEGz8YJkvM2NPiyjynGeqS0P0=; b=ZoaeU0Iq8EzGQv Kv/BftvwH0X6fBa6x8ViHBIm53CJ3yGwUZSQng264MVKMkp3HxAMms3PX5Da+7xFUFmO0WOW+a3Jx tvQtgckwyjVQ07QzvpxcC46RicG0kyCsV9gh/VhF7NTnk2cPVSSkrzTXDfiUd4Fw1Nz3z8xGJ2jLR xrKZUgqVPsvQx/8DmoJ6+y16FNALULxjhug2EwLtJm3/F+i4AkpEe/ZuXVrn/Iy5x/dBO+GlEgJB0 z2MT6AFRqieHxTm2XCgMco/79nfHVbWd+DahIn6veBn7JhDbk5FyIcZEeP7kKzHWPxSlWJ2Xq8tzd yGVvS7jqZrAnjzW8J7dQ==; 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 1jcHSp-0000Fi-3D; Fri, 22 May 2020 23:52:31 +0000 Received: from mail-io1-f68.google.com ([209.85.166.68]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jcHPB-0003V7-PN for linux-arm-kernel@lists.infradead.org; Fri, 22 May 2020 23:48:47 +0000 Received: by mail-io1-f68.google.com with SMTP id q129so4206291iod.6 for ; Fri, 22 May 2020 16:48:45 -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=A2f+A+UJfY1PJTDNi0NFbPeTlvbbCc37QATxTjmUPVg=; b=XXkvl8PQ2E8ZDeU4o14MRelKo/gFYpP0lCGflNB/unGH6nyKXspcK9U1ttRrsqVvY1 kRbhVjU2wld6eNJ3KOEH7ElL+gsUZN8SSlmr8n7b9mRl5qPnvQgm+Yt+SeiqAZ1VbWTn 6/5pbyKkJCH8G9AUy5ckqIddrXWtR/o11ID0WGbfYblunk2lFAjSiMzixQ+CzgZZv0z8 yu729XN8unsym6JYVu78j1loHDHuGnWgh1ouI3w+cA9OyA+/2RfT/FmLkxyAsaCR/Rhc d7pDxI5IMkDfRHwLWbScDtYiV9pv12y/kWorEy3MFcF/dAFtNQfVHD6XV9USOsTX5lDV PEwA== X-Gm-Message-State: AOAM5337Fd7gVE2AIFqsgOBPF6yIRFHIa4jz9r3cvkEql/phnjmkZwtj Fj5z+R5NmNDRk6T5+Qtynw== X-Google-Smtp-Source: ABdhPJz0drAdXL8tOrdvka5OuWYdrXyPsukcMKwJDfVFN/ZlnqO01gwrcMTn1syXCMOnmaFNfmE11w== X-Received: by 2002:a5d:9e55:: with SMTP id i21mr3535285ioi.130.1590191324652; Fri, 22 May 2020 16:48:44 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 16:48:43 -0700 (PDT) From: Rob Herring To: Lorenzo Pieralisi Subject: [PATCH 10/15] PCI: altera: Use pci_host_probe() to register host Date: Fri, 22 May 2020 17:48:27 -0600 Message-Id: <20200522234832.954484-11-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_164846_109817_A424DDB0 X-CRM114-Status: GOOD ( 11.88 ) 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: Bjorn Helgaas , linux-pci@vger.kernel.org, Ley Foon Tan , linux-arm-kernel@lists.infradead.org, rfi@lists.rocketboards.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 altera host driver does the same host registration and bus scanning calls as pci_host_probe, so let's use it instead. The only difference is pci_assign_unassigned_bus_resources() was called instead of pci_bus_size_bridges() and pci_bus_assign_resources(). This should be the same. Cc: Ley Foon Tan Cc: rfi@lists.rocketboards.org Signed-off-by: Rob Herring --- drivers/pci/controller/pcie-altera.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c index 24cb1c331058..26ac3ad81de0 100644 --- a/drivers/pci/controller/pcie-altera.c +++ b/drivers/pci/controller/pcie-altera.c @@ -773,8 +773,6 @@ static int altera_pcie_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct altera_pcie *pcie; - struct pci_bus *bus; - struct pci_bus *child; struct pci_host_bridge *bridge; int ret; const struct of_device_id *match; @@ -825,20 +823,7 @@ static int altera_pcie_probe(struct platform_device *pdev) bridge->map_irq = of_irq_parse_and_map_pci; bridge->swizzle_irq = pci_common_swizzle; - ret = pci_scan_root_bus_bridge(bridge); - if (ret < 0) - return ret; - - bus = bridge->bus; - - pci_assign_unassigned_bus_resources(bus); - - /* Configure PCI Express setting. */ - list_for_each_entry(child, &bus->children, node) - pcie_bus_configure_settings(child); - - pci_bus_add_devices(bus); - return ret; + return pci_host_probe(bridge); } static int altera_pcie_remove(struct platform_device *pdev) -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel