Received: by 10.192.165.148 with SMTP id m20csp1113492imm; Wed, 25 Apr 2018 12:49:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqldTwEKw5+8otmusy/7nm6S0UNLwoAOSQeXjQqZICrqMn4lZtC2kjU8yxiPb8jc9DOFw3t X-Received: by 2002:a17:902:b60b:: with SMTP id b11-v6mr2150929pls.330.1524685752112; Wed, 25 Apr 2018 12:49:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524685752; cv=none; d=google.com; s=arc-20160816; b=m+wxPIHfl/Mxln+BiD8XMy9YqjhPQcZQWBdZxtwZ7MhFNtSbJK+lJthPd6bTRUymuJ Cv4BDQKXMxn1i0IV3p44hiJZ3ys/o0puOiq4RVisAPKSUWuEG2jmOQKj24NFs1s3lzEd QzArYxsWgnD68lYSy1PYVrtnjMjbg4hbcSmQCzYOOQeLaLKXN01JKLghk5YhNJ4zvwW0 ZBR7ZqA3mbDdiSJLCcRvAs1tLc4S9iFcUzIQk4OSW29X2ge4IwrcJIRBKRwovWaXcUAv cIubQ8rViyJddng+1Sn606HpGro4RZGbmhKe3pwOEx2HC7jOVtPAqPz8nCKrkjiFYM0W N5Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:content-language :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:dkim-signature :arc-authentication-results; bh=SUfms4XGr17dYM1v7qyw7sYvOlfI2RuYfg2psQ590tI=; b=tFgxgkzQTi6HkB/MPdVJUvE4aTp2a4kR/vRB1IWRp4PyU9DSzxwbsV2n/K2FFl7dO4 Ou8kIKEEfWaLAmT6rbD2gPAqN2plmTWsvp7XJin1Dli61jlFFV5Pu0CJeOYJaIuVBHzo Yts8aAEHJzkwILzKM9OWlHIcncdOfw8z8J4lMIJkph7IY3wvJvye8hI56vqXM8bNqy/D hEtVGijDs3uwBWMGWw5Wngau26PfBgVV5j5mRXsBvdUTNbVn/AlAPiY7ph+J1AbgtcI2 eugeW6c1iAKSPu5ee1XDNM5XBI/Yhq2Gi7btWEp5C21RsQXW+vXgAwjkGdUE52kJdOao K8Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=O7cbeMng; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 7-v6si16792846plf.552.2018.04.25.12.48.57; Wed, 25 Apr 2018 12:49:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=O7cbeMng; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756372AbeDYTru (ORCPT + 99 others); Wed, 25 Apr 2018 15:47:50 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:47101 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751229AbeDYTrr (ORCPT ); Wed, 25 Apr 2018 15:47:47 -0400 Received: by mail-qt0-f194.google.com with SMTP id m16-v6so5021360qtg.13; Wed, 25 Apr 2018 12:47:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:references:in-reply-to:subject:date:message-id :mime-version:content-transfer-encoding:content-language :thread-index; bh=SUfms4XGr17dYM1v7qyw7sYvOlfI2RuYfg2psQ590tI=; b=O7cbeMngOaEpkTbUsGQZRq14IHCIVjzd9A6+8cZaZl4l7PnOjOJ+kdX/uFauhbqF4c DBJXgOPL6HiqOrY/pvRnZ25Qzlb8vzhfCjhpXlVS2T8K4hvrqLJLP4psHrDR4a5omtqy eq/23KgxqYLUxzHggtVr25fAlZkZoazUfjBTCv2ifQzwg/TlRlYuXhPVtzeuEwSN8xjS cz4PXoS5v1uT6MU1DfQ0F/8Q1VKqJ3d+iVkfClTLpNnDmBELa/rf5LAJZZgTMYpdbhc+ o2YLDtBn1YA4smbnY+xqPjR6LiDACkLnnES8AM0snXyrXS/23l4xzyW8iHKDEUfkuRTQ tfow== 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:references:in-reply-to:subject:date :message-id:mime-version:content-transfer-encoding:content-language :thread-index; bh=SUfms4XGr17dYM1v7qyw7sYvOlfI2RuYfg2psQ590tI=; b=LkFWFwi+bZ05t1mbQ02H8BMl+hvh++wSOaZKSCQRw2F8VNxi1N34GCpQg9UbYvn3EE TqmAv8sQK7PG9qeT+sQMbcWnwraCS4DLCJp+jlyLbqaLmo5nPZ0vSmfg4ManoPXs4vSe Y7tPBavFHoQXJIzN4vEDL8MDwj1uCi73w9YkFjFcG0t3urG9ImE8hvQlsFMcIXr+7CO4 cLS3VMHyz2Jh0Jf+elAUeJVrlTKK0BpsSz/QslVhM5UKsQ4PoGzvAOP1oQHrRi7+xDTU XqRy7lUCZ5pEg4omLkQ9BYC59fr7J0sqNE5lLk7RDVtM3YY1Gb74Z5on4QcZSI/Td4Fh 8otQ== X-Gm-Message-State: ALQs6tBBtApnGC4N5fDADBZeQ1w52+EYfmKmxoUPancmeQ7d9HpQzPX5 oiuQOcp6yDZI/9hQzsCDAN0= X-Received: by 2002:ac8:3af:: with SMTP id t47-v6mr32655336qtg.117.1524685666526; Wed, 25 Apr 2018 12:47:46 -0700 (PDT) Received: from DESKTOP3JAHB13 ([2001:468:c80:4391:899e:c79:7135:16af]) by smtp.gmail.com with ESMTPSA id q33sm16463860qkq.72.2018.04.25.12.47.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Apr 2018 12:47:45 -0700 (PDT) From: "Jingoo Han" To: "'Jan Kiszka'" , "'Bjorn Helgaas'" , "'Linux Kernel Mailing List'" , , Cc: "'Joao Pinto'" , "'Lorenzo Pieralisi'" References: In-Reply-To: Subject: Re: [PATCH 4/6] PCI: Convert of_pci_get_host_bridge_resources users to devm variant Date: Wed, 25 Apr 2018 15:47:44 -0400 Message-ID: <000001d3dcce$48284a10$d878de30$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-language: en-us Thread-Index: AQLCyUGf+pkn6FeD4OB2aWVwvljqdgF68uJHoigyL0A= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Jan Kiszka > Sent: Tuesday, April 24, 2018 11:14 AM > To: Bjorn Helgaas ; Linux Kernel Mailing List kernel@vger.kernel.org>; linux-pci@vger.kernel.org; linux-arm- > kernel@lists.infradead.org > Cc: Jingoo Han ; Joao Pinto > ; Lorenzo Pieralisi > Subject: [PATCH 4/6] PCI: Convert of_pci_get_host_bridge_resources users > to devm variant > > From: Jan Kiszka > > Straightforward for all of them, no more leaks afterwards. > > CC: Jingoo Han For drivers/pci/dwc/pcie-designware-host.c, Acked-by: Jingoo Han Best regards, Jingoo Han > CC: Joao Pinto > CC: Lorenzo Pieralisi > Signed-off-by: Jan Kiszka > --- > drivers/pci/dwc/pcie-designware-host.c | 2 +- > drivers/pci/host/pci-aardvark.c | 5 ++--- > drivers/pci/host/pci-ftpci100.c | 4 ++-- > drivers/pci/host/pci-v3-semi.c | 3 ++- > drivers/pci/host/pci-versatile.c | 3 +-- > drivers/pci/host/pci-xgene.c | 3 ++- > drivers/pci/host/pcie-altera.c | 5 ++--- > drivers/pci/host/pcie-iproc-platform.c | 4 ++-- > drivers/pci/host/pcie-rcar.c | 5 ++--- > drivers/pci/host/pcie-rockchip.c | 4 ++-- > drivers/pci/host/pcie-xilinx-nwl.c | 4 ++-- > drivers/pci/host/pcie-xilinx.c | 4 ++-- > drivers/pci/of.c | 4 ++-- > 13 files changed, 24 insertions(+), 26 deletions(-) > > diff --git a/drivers/pci/dwc/pcie-designware-host.c > b/drivers/pci/dwc/pcie-designware-host.c > index 6c409079d514..a8f6ab54b4c0 100644 > --- a/drivers/pci/dwc/pcie-designware-host.c > +++ b/drivers/pci/dwc/pcie-designware-host.c > @@ -342,7 +342,7 @@ int dw_pcie_host_init(struct pcie_port *pp) > if (!bridge) > return -ENOMEM; > > - ret = of_pci_get_host_bridge_resources(np, 0, 0xff, > + ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, > &bridge->windows, &pp->io_base); > if (ret) > return ret; > diff --git a/drivers/pci/host/pci-aardvark.c b/drivers/pci/host/pci- > aardvark.c > index b04d37b3c5de..709f0d69e35b 100644 > --- a/drivers/pci/host/pci-aardvark.c > +++ b/drivers/pci/host/pci-aardvark.c > @@ -815,14 +815,13 @@ static int > advk_pcie_parse_request_of_pci_ranges(struct advk_pcie *pcie) > { > int err, res_valid = 0; > struct device *dev = &pcie->pdev->dev; > - struct device_node *np = dev->of_node; > struct resource_entry *win, *tmp; > resource_size_t iobase; > > INIT_LIST_HEAD(&pcie->resources); > > - err = of_pci_get_host_bridge_resources(np, 0, 0xff, &pcie- > >resources, > - &iobase); > + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, > + &pcie->resources, &iobase); > if (err) > return err; > > diff --git a/drivers/pci/host/pci-ftpci100.c b/drivers/pci/host/pci- > ftpci100.c > index 5008fd87956a..87748eaeaaed 100644 > --- a/drivers/pci/host/pci-ftpci100.c > +++ b/drivers/pci/host/pci-ftpci100.c > @@ -476,8 +476,8 @@ static int faraday_pci_probe(struct platform_device > *pdev) > if (IS_ERR(p->base)) > return PTR_ERR(p->base); > > - ret = of_pci_get_host_bridge_resources(dev->of_node, 0, 0xff, > - &res, &io_base); > + ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, > + &res, &io_base); > if (ret) > return ret; > > diff --git a/drivers/pci/host/pci-v3-semi.c b/drivers/pci/host/pci-v3- > semi.c > index 0a4dea796663..167bf6f6b378 100644 > --- a/drivers/pci/host/pci-v3-semi.c > +++ b/drivers/pci/host/pci-v3-semi.c > @@ -791,7 +791,8 @@ static int v3_pci_probe(struct platform_device *pdev) > if (IS_ERR(v3->config_base)) > return PTR_ERR(v3->config_base); > > - ret = of_pci_get_host_bridge_resources(np, 0, 0xff, &res, &io_base); > + ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, > + &io_base); > if (ret) > return ret; > > diff --git a/drivers/pci/host/pci-versatile.c b/drivers/pci/host/pci- > versatile.c > index 5b3876f5312b..ff2cd12b3978 100644 > --- a/drivers/pci/host/pci-versatile.c > +++ b/drivers/pci/host/pci-versatile.c > @@ -64,11 +64,10 @@ static int > versatile_pci_parse_request_of_pci_ranges(struct device *dev, > struct list_head *res) > { > int err, mem = 1, res_valid = 0; > - struct device_node *np = dev->of_node; > resource_size_t iobase; > struct resource_entry *win, *tmp; > > - err = of_pci_get_host_bridge_resources(np, 0, 0xff, res, &iobase); > + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, res, > &iobase); > if (err) > return err; > > diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c > index 0a0d7ee6d3c9..7b3ed6e34b6c 100644 > --- a/drivers/pci/host/pci-xgene.c > +++ b/drivers/pci/host/pci-xgene.c > @@ -632,7 +632,8 @@ static int xgene_pcie_probe(struct platform_device > *pdev) > if (ret) > return ret; > > - ret = of_pci_get_host_bridge_resources(dn, 0, 0xff, &res, &iobase); > + ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, > + &iobase); > if (ret) > return ret; > > diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie- > altera.c > index a6af62e0256d..49410c7ba0cc 100644 > --- a/drivers/pci/host/pcie-altera.c > +++ b/drivers/pci/host/pcie-altera.c > @@ -488,11 +488,10 @@ static int > altera_pcie_parse_request_of_pci_ranges(struct altera_pcie *pcie) > { > int err, res_valid = 0; > struct device *dev = &pcie->pdev->dev; > - struct device_node *np = dev->of_node; > struct resource_entry *win; > > - err = of_pci_get_host_bridge_resources(np, 0, 0xff, &pcie- > >resources, > - NULL); > + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff > + &pcie->resources, NULL); > if (err) > return err; > > diff --git a/drivers/pci/host/pcie-iproc-platform.c > b/drivers/pci/host/pcie-iproc-platform.c > index e764a2a2693c..99c2022813e4 100644 > --- a/drivers/pci/host/pcie-iproc-platform.c > +++ b/drivers/pci/host/pcie-iproc-platform.c > @@ -99,8 +99,8 @@ static int iproc_pcie_pltfm_probe(struct platform_device > *pdev) > pcie->phy = NULL; > } > > - ret = of_pci_get_host_bridge_resources(np, 0, 0xff, &resources, > - &iobase); > + ret = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, > &resources, > + &iobase); > if (ret) { > dev_err(dev, "unable to get PCI host bridge resources\n"); > return ret; > diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c > index 6ab28f29ac6a..6eb36c924983 100644 > --- a/drivers/pci/host/pcie-rcar.c > +++ b/drivers/pci/host/pcie-rcar.c > @@ -1067,12 +1067,11 @@ static int > rcar_pcie_parse_request_of_pci_ranges(struct rcar_pcie *pci) > { > int err; > struct device *dev = pci->dev; > - struct device_node *np = dev->of_node; > resource_size_t iobase; > struct resource_entry *win, *tmp; > > - err = of_pci_get_host_bridge_resources(np, 0, 0xff, &pci->resources, > - &iobase); > + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, > + &pci->resources, &iobase); > if (err) > return err; > > diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie- > rockchip.c > index f1e8f97ea1fb..27b97fcddf15 100644 > --- a/drivers/pci/host/pcie-rockchip.c > +++ b/drivers/pci/host/pcie-rockchip.c > @@ -1560,8 +1560,8 @@ static int rockchip_pcie_probe(struct > platform_device *pdev) > if (err < 0) > goto err_deinit_port; > > - err = of_pci_get_host_bridge_resources(dev->of_node, 0, 0xff, > - &res, &io_base); > + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, > + &res, &io_base); > if (err) > goto err_remove_irq_domain; > > diff --git a/drivers/pci/host/pcie-xilinx-nwl.c b/drivers/pci/host/pcie- > xilinx-nwl.c > index 4839ae578711..64df768c795c 100644 > --- a/drivers/pci/host/pcie-xilinx-nwl.c > +++ b/drivers/pci/host/pcie-xilinx-nwl.c > @@ -825,7 +825,6 @@ static const struct of_device_id nwl_pcie_of_match[] = > { > static int nwl_pcie_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > - struct device_node *node = dev->of_node; > struct nwl_pcie *pcie; > struct pci_bus *bus; > struct pci_bus *child; > @@ -855,7 +854,8 @@ static int nwl_pcie_probe(struct platform_device *pdev) > return err; > } > > - err = of_pci_get_host_bridge_resources(node, 0, 0xff, &res, > &iobase); > + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, > + &iobase); > if (err) { > dev_err(dev, "Getting bridge resources failed\n"); > return err; > diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie- > xilinx.c > index 0ad188effc09..88c96e5669e0 100644 > --- a/drivers/pci/host/pcie-xilinx.c > +++ b/drivers/pci/host/pcie-xilinx.c > @@ -643,8 +643,8 @@ static int xilinx_pcie_probe(struct platform_device > *pdev) > return err; > } > > - err = of_pci_get_host_bridge_resources(dev->of_node, 0, 0xff, &res, > - &iobase); > + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, &res, > + &iobase); > if (err) { > dev_err(dev, "Getting bridge resources failed\n"); > return err; > diff --git a/drivers/pci/of.c b/drivers/pci/of.c > index 6eab0bde2ab3..4f816c93e562 100644 > --- a/drivers/pci/of.c > +++ b/drivers/pci/of.c > @@ -626,12 +626,12 @@ int pci_parse_request_of_pci_ranges(struct device > *dev, > struct resource **bus_range) > { > int err, res_valid = 0; > - struct device_node *np = dev->of_node; > resource_size_t iobase; > struct resource_entry *win, *tmp; > > INIT_LIST_HEAD(resources); > - err = of_pci_get_host_bridge_resources(np, 0, 0xff, resources, > &iobase); > + err = devm_of_pci_get_host_bridge_resources(dev, 0, 0xff, resources, > + &iobase); > if (err) > return err; > > -- > 2.13.6