From patchwork Wed Jul 22 02:25:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 11677021 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 4E7A414E3 for ; Wed, 22 Jul 2020 02:26:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 34C95207CD for ; Wed, 22 Jul 2020 02:26:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595384768; bh=7tAZOIGUB+mpgkkJCUhc0x9ljfn9KK4ClFTerMLuM/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mfMFBxEgR4LI5GMRK2pVqktjbvspy5U3seKCmEUemTMpv72o0NXl9zjxMkJsVuNCl yhzMoZe1bK/0xstnDu5NMY4ifleQyi2peY6PTeiNztxJPkRT9RBm8TAV9D1LoVLP3k gPwVcrakBM0JSCtY714dumpS3lZ190UXQYG3qwGc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731831AbgGVC0H (ORCPT ); Tue, 21 Jul 2020 22:26:07 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:45993 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731782AbgGVC0H (ORCPT ); Tue, 21 Jul 2020 22:26:07 -0400 Received: by mail-io1-f68.google.com with SMTP id e64so837105iof.12; Tue, 21 Jul 2020 19:26:06 -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=Sx6GVOI+dfrOqGHWvn9QoM3JtOMYpq/JE8Tqqq/XESo=; b=hRecjmbwTW6e625du/eX6WV5/gikkYApXhpuoa294ySum3AElHkQrl4nRzIh6/uC4Q QAL7xJR08aAvOzGODJzE2RXhRYBbLQv8B9cl7d3W2QxWhR0bVDiKsvgiNRukNLG0nFuZ HxRS19LAWxhtxp4ns+14O41cz/20XC6SQ1ppd/hkgRZbiRuE3OShqbraXIhPSc5QBM3E F73y1fBpt58qwouT0Cbyatgs9Skyoe8DMnuy61D9yFTEsJoGTztxHKSiKP6mqBkcRZ7k I/NYgFxJLo86ECN0jWhl3EtSs0BjigdWw+KD5Su9brF/Ni1aQsFmicUbVM4S07xsDcwV wdGQ== X-Gm-Message-State: AOAM530zqg0sNLjQpTdhwbMmMy4oI7IvTqPl45g6ufR1wyeIclkolcro HTo3GHo88YmsuhdcdaM3tA== X-Google-Smtp-Source: ABdhPJze1eEfXQhm3Te+g4pDNDpupsU66DO3G9MUAMxA5XH1jcrIjVL0er8s/IRb3RapW1a/bMPdhw== X-Received: by 2002:a05:6e02:e05:: with SMTP id a5mr28941292ilk.92.1595384766206; Tue, 21 Jul 2020 19:26:06 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.252]) by smtp.googlemail.com with ESMTPSA id y2sm11687981iox.22.2020.07.21.19.26.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 19:26:05 -0700 (PDT) From: Rob Herring To: Bjorn Helgaas , Lorenzo Pieralisi Cc: Fabio Estevam , Gustavo Pimentel , Heiko Stuebner , Hou Zhiqiang , Jingoo Han , Jonathan Hunter , Karthikeyan Mitran , Linus Walleij , Lucas Stach , Marek Vasut , Michal Simek , Murali Karicheri , NXP Linux Team , Pengutronix Kernel Team , Richard Zhu , Ryder Lee , Sascha Hauer , Shawn Guo , Shawn Lin , Thierry Reding , Thomas Petazzoni , Tom Joseph , Will Deacon , Yoshihiro Shimoda , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pci@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-tegra@vger.kernel.org Subject: [PATCH 14/19] PCI: rcar: Use devm_pci_alloc_host_bridge() Date: Tue, 21 Jul 2020 20:25:09 -0600 Message-Id: <20200722022514.1283916-15-robh@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200722022514.1283916-1-robh@kernel.org> References: <20200722022514.1283916-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 Move to the resource managed devm_pci_alloc_host_bridge() and simplify the error path. Cc: Marek Vasut Cc: Yoshihiro Shimoda Cc: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: linux-renesas-soc@vger.kernel.org Signed-off-by: Rob Herring --- drivers/pci/controller/pcie-rcar-host.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c index 58f4d339eb0c..c470bff5af0f 100644 --- a/drivers/pci/controller/pcie-rcar-host.c +++ b/drivers/pci/controller/pcie-rcar-host.c @@ -940,7 +940,7 @@ static int rcar_pcie_probe(struct platform_device *pdev) int err; struct pci_host_bridge *bridge; - bridge = pci_alloc_host_bridge(sizeof(*host)); + bridge = devm_pci_alloc_host_bridge(dev, sizeof(*host)); if (!bridge) return -ENOMEM; @@ -952,7 +952,7 @@ static int rcar_pcie_probe(struct platform_device *pdev) err = pci_parse_request_of_pci_ranges(dev, &host->resources, &bridge->dma_ranges, NULL); if (err) - goto err_free_bridge; + return err; pm_runtime_enable(pcie->dev); err = pm_runtime_get_sync(pcie->dev); @@ -1034,9 +1034,6 @@ static int rcar_pcie_probe(struct platform_device *pdev) pm_runtime_disable(dev); pci_free_resource_list(&host->resources); -err_free_bridge: - pci_free_host_bridge(bridge); - return err; }