From patchwork Wed Oct 16 20:06:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 11194193 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E6F21575 for ; Wed, 16 Oct 2019 20:07:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F1C9218DE for ; Wed, 16 Oct 2019 20:07:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571256425; bh=BTQ4RHZzaHCiAdu/KCli4oXc5l4kc3TujC5/TepvS4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=sX5xev3hxN/9pFHujAc4pGL9id1xqmsNHfN6wwctphR1XAF0RAZc592H3MeHRoKKi Qs5dnxxDEBnUqJtEodDAKtc0A58o2HCEwu3XKzV7pKG1VTP0+SbS04TjcGPdtTFOVy Nl03UyDQgN/41GRLFJ7+41XqhuZHZGpNblx0a6Og= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732199AbfJPUHF (ORCPT ); Wed, 16 Oct 2019 16:07:05 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:46449 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731066AbfJPUHE (ORCPT ); Wed, 16 Oct 2019 16:07:04 -0400 Received: by mail-oi1-f196.google.com with SMTP id k25so83047oiw.13; Wed, 16 Oct 2019 13:07:04 -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=EDKT0k2rW2df/qxcfzGpJ4gbuqrSVLzlSAOOYJLl1ZU=; b=PKsPOo2WwdyNPffaSx+xQFfgAPLSj4haztcNPRlufAo7fLEuyiXr5xGmvRxnibAbIw hPAUm5vBGi98sgXKDv5BHsqOdHS9RkeKf0uXqFSqS9EhNwhazz4Z5bi3d4Ty1okiZc2Y rMMSPHn5FgveDuuKC8PptDYKO6FTj2IYM1vYlOVf9Plemzc1KpwwUSJFO2NIx+fpaOPw VC3rIwOs9aZLeifFudZor2NdwpE/VCpValygtNTFaKbkl7yeJVR/8KGlBMc8ycw7zHQ2 a5r/l7HGG24+MtEMxJP9yddf+ehzIDj/oH3KMDOeIO3L0TfAD2LwHT2w81ScqQ8BLJKN CTsw== X-Gm-Message-State: APjAAAXyGHngI8ouxteSze5t5DY8jdKP9v+4zWGkATgRw9MUxU+VFl7v edaYU1RJeovXAS392q+cyg== X-Google-Smtp-Source: APXvYqy5QNsQYGo2OxYTIHoisvgxNgeFY9E1I7izTYC+dFVMgvQdtLKYCMk+PvbGpjM7lphnHGqeAg== X-Received: by 2002:aca:6509:: with SMTP id m9mr91546oim.63.1571256423758; Wed, 16 Oct 2019 13:07:03 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id a9sm7412463oie.7.2019.10.16.13.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2019 13:07:03 -0700 (PDT) From: Rob Herring To: Andrew Murray , Bjorn Helgaas , Lorenzo Pieralisi Cc: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, Gustavo Pimentel , Heiko Stuebner , Hou Zhiqiang , Jingoo Han , Karthikeyan Mitran , Ley Foon Tan , Linus Walleij , linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, Matthias Brugger , Michal Simek , Ray Jui , rfi@lists.rocketboards.org, Ryder Lee , Scott Branden , Shawn Lin , Simon Horman , Srinath Mannam , Thomas Petazzoni , Toan Le , Tom Joseph , Will Deacon Subject: [PATCH v2 07/25] PCI: iproc: Use pci_parse_request_of_pci_ranges() Date: Wed, 16 Oct 2019 15:06:29 -0500 Message-Id: <20191016200647.32050-8-robh@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191016200647.32050-1-robh@kernel.org> References: <20191016200647.32050-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Convert the iProc host bridge to use the common pci_parse_request_of_pci_ranges(). There's no need to assign the resources to a temporary list, so just use bridge->windows directly. Cc: Lorenzo Pieralisi Cc: Andrew Murray Cc: Bjorn Helgaas Cc: Ray Jui Cc: Scott Branden Cc: bcm-kernel-feedback-list@broadcom.com Signed-off-by: Rob Herring Reviewed-by: Andrew Murray --- v2: - New patch drivers/pci/controller/pcie-iproc-platform.c | 8 ++------ drivers/pci/controller/pcie-iproc.c | 5 ----- 2 files changed, 2 insertions(+), 11 deletions(-) -- 2.20.1 diff --git a/drivers/pci/controller/pcie-iproc-platform.c b/drivers/pci/controller/pcie-iproc-platform.c index 9ee6200a66f4..375d815f7301 100644 --- a/drivers/pci/controller/pcie-iproc-platform.c +++ b/drivers/pci/controller/pcie-iproc-platform.c @@ -43,8 +43,6 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev) struct iproc_pcie *pcie; struct device_node *np = dev->of_node; struct resource reg; - resource_size_t iobase = 0; - LIST_HEAD(resources); struct pci_host_bridge *bridge; int ret; @@ -97,8 +95,7 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev) if (IS_ERR(pcie->phy)) return PTR_ERR(pcie->phy); - ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &resources, - &iobase); + ret = pci_parse_request_of_pci_ranges(dev, &bridge->windows, NULL); if (ret) { dev_err(dev, "unable to get PCI host bridge resources\n"); return ret; @@ -113,10 +110,9 @@ static int iproc_pcie_pltfm_probe(struct platform_device *pdev) pcie->map_irq = of_irq_parse_and_map_pci; } - ret = iproc_pcie_setup(pcie, &resources); + ret = iproc_pcie_setup(pcie, &bridge->windows); if (ret) { dev_err(dev, "PCIe controller setup failed\n"); - pci_free_resource_list(&resources); return ret; } diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c index 2d457bfdaf66..223335ee791a 100644 --- a/drivers/pci/controller/pcie-iproc.c +++ b/drivers/pci/controller/pcie-iproc.c @@ -1498,10 +1498,6 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res) return ret; } - ret = devm_request_pci_bus_resources(dev, res); - if (ret) - return ret; - ret = phy_init(pcie->phy); if (ret) { dev_err(dev, "unable to initialize PCIe PHY\n"); @@ -1543,7 +1539,6 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res) if (iproc_pcie_msi_enable(pcie)) dev_info(dev, "not using iProc MSI\n"); - list_splice_init(res, &host->windows); host->busnr = 0; host->dev.parent = dev; host->ops = &iproc_pcie_ops;