From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751025AbeECHSb (ORCPT ); Thu, 3 May 2018 03:18:31 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:50345 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750703AbeECHSa (ORCPT ); Thu, 3 May 2018 03:18:30 -0400 Subject: Re: [PATCH v2 07/10] PCI: Convert of_pci_get_host_bridge_resources() users to devm variant To: Jan Kiszka , Bjorn Helgaas , Linux Kernel Mailing List , , References: CC: Jingoo Han , Joao Pinto , Lorenzo Pieralisi From: Vladimir Zapolskiy Message-ID: Date: Thu, 3 May 2018 10:18:24 +0300 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [137.202.0.87] X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jan, On 04/30/2018 08:48 AM, Jan Kiszka wrote: > From: Jan Kiszka > > Straightforward for all of them, no more leaks afterwards. > > CC: Jingoo Han > CC: Joao Pinto > CC: Lorenzo Pieralisi > Signed-off-by: Jan Kiszka > Acked-by: Jingoo Han [snip] > 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; > this one snippet is obsoleted by https://patchwork.ozlabs.org/patch/904326/ If 08/10 remains a deprecation, then it is sufficient to exclude the R-Car change, otherwise I hope maintainers can deal with the proper ordering. For PCI OF change: > diff --git a/drivers/pci/of.c b/drivers/pci/of.c > index f16b343d3b85..5a88d46a41b7 100644 > --- a/drivers/pci/of.c > +++ b/drivers/pci/of.c > @@ -645,12 +645,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; > > Reviewed-by: Vladimir Zapolskiy Tested-by: Vladimir Zapolskiy -- With best wishes, Vladimir From mboxrd@z Thu Jan 1 00:00:00 1970 From: vladimir_zapolskiy@mentor.com (Vladimir Zapolskiy) Date: Thu, 3 May 2018 10:18:24 +0300 Subject: [PATCH v2 07/10] PCI: Convert of_pci_get_host_bridge_resources() users to devm variant In-Reply-To: References: Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Jan, On 04/30/2018 08:48 AM, Jan Kiszka wrote: > From: Jan Kiszka > > Straightforward for all of them, no more leaks afterwards. > > CC: Jingoo Han > CC: Joao Pinto > CC: Lorenzo Pieralisi > Signed-off-by: Jan Kiszka > Acked-by: Jingoo Han [snip] > 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; > this one snippet is obsoleted by https://patchwork.ozlabs.org/patch/904326/ If 08/10 remains a deprecation, then it is sufficient to exclude the R-Car change, otherwise I hope maintainers can deal with the proper ordering. For PCI OF change: > diff --git a/drivers/pci/of.c b/drivers/pci/of.c > index f16b343d3b85..5a88d46a41b7 100644 > --- a/drivers/pci/of.c > +++ b/drivers/pci/of.c > @@ -645,12 +645,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; > > Reviewed-by: Vladimir Zapolskiy Tested-by: Vladimir Zapolskiy -- With best wishes, Vladimir