From patchwork Wed Oct 16 20:06:36 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: 11194221 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 48B9914DB for ; Wed, 16 Oct 2019 20:07:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C1B920663 for ; Wed, 16 Oct 2019 20:07:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571256438; bh=LCfqvvorTXD7djPQGH2Mfgy8rwxzT4bpAvZBKEbfa7w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=aDTb3znV67rEm23JfFnLQawX4dLs1LwENS8umyk6fotplpY75T3WH5tPlJzopYoHE /2yk5RmktLLIoJt0l8s9j4i0c9GEtumPiaEniayqqg3ckDCyFp1Z2bNGojBQkFwsYW Ut0ZXIjy3i5Z0VdoOYkApabLapUqYUUSNE30gb/s= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732659AbfJPUHR (ORCPT ); Wed, 16 Oct 2019 16:07:17 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:39093 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732214AbfJPUHR (ORCPT ); Wed, 16 Oct 2019 16:07:17 -0400 Received: by mail-oi1-f196.google.com with SMTP id w144so119398oia.6; Wed, 16 Oct 2019 13:07:17 -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=/1oYAep1iMpZDyVd+bc5fdO9/WhUAJcxCL7Y+S+HNKM=; b=pQjaJs/sYVc4Wti02EsBI/+dmwt+YR7hMuqkKJC9EB5F40XeT9jCEpjNZaDMVJtu9Z z4FHAxs/2c2CjGCA6LJZmrE1XoM1PvURd7op3onjxZUtROEtw3HqQGKwA27ajZ8LS7LY 7KT2WlorBe39idHSRhOvxW4j6FoNATLcKsFiIv7UCEpFFQ/uIq8qSEaRQCY602tFGFtP pqVG4qiwZbxOAS0fGGKMli58SFS+EFtYwSzdVhpvVLc2nntRpWxh4JKPbgsneoR96v4t ZZta+k/vKXdOOyBXE2kEamNql7IMH3ftRKYDIOjdgcVGKIWBqYFapgn1P8iaixHPpGJH A+iA== X-Gm-Message-State: APjAAAUb+S7j5ApWv2QJ94/kYnaCLh2pBBT9QQ/wR1pscm6E4wDY+2em 8Q/5xO5CSLl16XdEur9+dQ== X-Google-Smtp-Source: APXvYqz66F2v4b5Ld2gp0cxp3wU06Hj5buWMISghPeAHsAtQ+/9CM9ObzMQbSYC2ymEYHYsz/zThqw== X-Received: by 2002:aca:221a:: with SMTP id b26mr117376oic.86.1571256436526; Wed, 16 Oct 2019 13:07:16 -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.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2019 13:07:15 -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 14/25] PCI: xilinx: Use pci_parse_request_of_pci_ranges() Date: Wed, 16 Oct 2019 15:06:36 -0500 Message-Id: <20191016200647.32050-15-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 Xilinx host bridge to use the common pci_parse_request_of_pci_ranges(). There's no need to assign the resources to a temporary list first. Just use bridge->windows directly and remove all the temporary list handling. Cc: Lorenzo Pieralisi Cc: Andrew Murray Cc: Bjorn Helgaas Cc: Michal Simek Signed-off-by: Rob Herring --- v2: - New patch drivers/pci/controller/pcie-xilinx.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) -- 2.20.1 diff --git a/drivers/pci/controller/pcie-xilinx.c b/drivers/pci/controller/pcie-xilinx.c index 5bf3af3b28e6..257702288787 100644 --- a/drivers/pci/controller/pcie-xilinx.c +++ b/drivers/pci/controller/pcie-xilinx.c @@ -619,8 +619,6 @@ static int xilinx_pcie_probe(struct platform_device *pdev) struct pci_bus *bus, *child; struct pci_host_bridge *bridge; int err; - resource_size_t iobase = 0; - LIST_HEAD(res); if (!dev->of_node) return -ENODEV; @@ -647,19 +645,12 @@ static int xilinx_pcie_probe(struct platform_device *pdev) return err; } - err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, - &iobase); + err = pci_parse_request_of_pci_ranges(dev, &bridge->windows, NULL); if (err) { dev_err(dev, "Getting bridge resources failed\n"); return err; } - err = devm_request_pci_bus_resources(dev, &res); - if (err) - goto error; - - - list_splice_init(&res, &bridge->windows); bridge->dev.parent = dev; bridge->sysdata = port; bridge->busnr = 0; @@ -673,7 +664,7 @@ static int xilinx_pcie_probe(struct platform_device *pdev) #endif err = pci_scan_root_bus_bridge(bridge); if (err < 0) - goto error; + return err; bus = bridge->bus; @@ -682,10 +673,6 @@ static int xilinx_pcie_probe(struct platform_device *pdev) pcie_bus_configure_settings(child); pci_bus_add_devices(bus); return 0; - -error: - pci_free_resource_list(&res); - return err; } static const struct of_device_id xilinx_pcie_of_match[] = {