Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp256162imm; Tue, 15 May 2018 00:56:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoDPgluvKPiXI4aK679hz7WatKwVN5cUzI1Qv286Hmn5/7ZEwwZmNZumyNSb9kkxfdvqebB X-Received: by 2002:a62:2043:: with SMTP id g64-v6mr14053377pfg.12.1526370972206; Tue, 15 May 2018 00:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526370972; cv=none; d=google.com; s=arc-20160816; b=Fy1ma2qdgvRx1PatmBKLHFu3KEfXw6RDy6VqNcLdWaE3/5CMhteUHxLBN+OC9CDec8 ESInsM2BpZqbhfwro9DUcESRcqDHGD12QD1+Qs1RQi04UQAKc6wSLfFH6NG6jB01+Rej JXMB2TZLKtDkt+aMYpoBFDDDe895HMUYnaf5dwFVZjiAq/Rfu5AIFHCQjHf4g7NLLKyU JwgqRaE+5Y1uagt6QtIQYCJqxdD2aziTzd3gmoInUTBN7Iw6sxbeorlHOcXuQYfPMTxY TNu68glOsJkyKAWGdGFNw6Hf7yQorPMjgitLoH6GpJFlJvExgw9wAMJ3slprIZWMQMxx RPvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=ThqSMcpYqgHDUnnQlSYjcQS0QS/n9FK+wBN2a63oFLU=; b=SntJo3NG/otzf0JjCcba6LcZjsIKC97lmYedE1nimDRK4R0JmVbjbmbyj/7tyfo0Nd Bq5RM+93EWz01h2S6LDPAFNjKCyOzy+ulPpCRHRPQgGLCu8z2k8b0jlFJpApo5JahxcM oEUeANVaOxo5oOY2lwkLOoUwwfkJ2kECdCxLMo5eAgCLhkJjU4Z2HsN5tsOdYewCEOD7 OhRaL1H6AGR8cETc1NxQk8fw0zYEeVi/NEKuP+DA5PXsOkId9X+vu2/E//rR/kC5VeCQ 2fCXXWleIzLDEhaHmEyhrNnFIDivpgFJhgDb1eSH816X6X6gZ1FCUZb4E3QZsSNnv+zO nyJw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n25-v6si9441006pgc.42.2018.05.15.00.55.57; Tue, 15 May 2018 00:56: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752406AbeEOHyt (ORCPT + 99 others); Tue, 15 May 2018 03:54:49 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:60812 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752337AbeEOHyr (ORCPT ); Tue, 15 May 2018 03:54:47 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1fIUnG-0000SR-W2 from Vladimir_Zapolskiy@mentor.com ; Tue, 15 May 2018 00:54:47 -0700 Received: from [137.202.108.125] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Tue, 15 May 2018 08:54:33 +0100 Subject: Re: [PATCH v3 4/8] PCI: Replace dev_node parameter of of_pci_get_host_bridge_resources with device To: Jan Kiszka , Bjorn Helgaas , Linux Kernel Mailing List , , References: <5f2226585c6af9920b266d0503e32042d4c9e440.1526363896.git.jan.kiszka@siemens.com> CC: Jingoo Han , Joao Pinto , Lorenzo Pieralisi From: Vladimir Zapolskiy Message-ID: Date: Tue, 15 May 2018 10:54:33 +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: <5f2226585c6af9920b266d0503e32042d4c9e440.1526363896.git.jan.kiszka@siemens.com> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jan, On 05/15/2018 08:58 AM, Jan Kiszka wrote: > From: Jan Kiszka > > Another step towards a managed version of > of_pci_get_host_bridge_resources(): Feed in the underlying device, > rather than just the OF node. This will allow to use managed resource > allocation internally later on. > > CC: Jingoo Han > CC: Joao Pinto > CC: Lorenzo Pieralisi > Signed-off-by: Jan Kiszka [snip] > diff --git a/drivers/pci/of.c b/drivers/pci/of.c > index 8d4778ef5806..ac97491ba377 100644 > --- a/drivers/pci/of.c > +++ b/drivers/pci/of.c > @@ -245,7 +245,7 @@ EXPORT_SYMBOL_GPL(of_pci_check_probe_only); > #if defined(CONFIG_OF_ADDRESS) > /** > * of_pci_get_host_bridge_resources - Parse PCI host bridge resources from DT > - * @dev_node: device node of the host bridge having the range property > + * @dev: host bridge device > * @busno: bus number associated with the bridge root bus > * @bus_max: maximum number of buses for this bridge > * @resources: list where the range of resources will be added after DT parsing > @@ -262,10 +262,11 @@ EXPORT_SYMBOL_GPL(of_pci_check_probe_only); > * It returns zero if the range parsing has been successful or a standard error > * value if it failed. > */ > -int of_pci_get_host_bridge_resources(struct device_node *dev_node, > +int of_pci_get_host_bridge_resources(struct device *dev, > unsigned char busno, unsigned char bus_max, > struct list_head *resources, resource_size_t *io_base) > { > + struct device_node *dev_node = dev->of_node; > struct resource_entry *window; > struct resource *res; > struct resource *bus_range; > @@ -599,12 +600,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 = of_pci_get_host_bridge_resources(dev, 0, 0xff, resources, > + &iobase); just a note, it's a funny selected indentation style across this change to avoid indentation issues in v3 6/8. It seems to be innocent though. > if (err) > return err; > > diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h > index 74eec1943ad2..e6684c68cb94 100644 > --- a/include/linux/of_pci.h > +++ b/include/linux/of_pci.h > @@ -71,11 +71,11 @@ of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin) > #endif > > #if defined(CONFIG_OF_ADDRESS) > -int of_pci_get_host_bridge_resources(struct device_node *dev_node, > +int of_pci_get_host_bridge_resources(struct device *dev, > unsigned char busno, unsigned char bus_max, > struct list_head *resources, resource_size_t *io_base); > #else > -static inline int of_pci_get_host_bridge_resources(struct device_node *dev_node, > +static inline int of_pci_get_host_bridge_resources(struct device *dev, > unsigned char busno, unsigned char bus_max, > struct list_head *resources, resource_size_t *io_base) > { > Tested-by: Vladimir Zapolskiy Reviewed-by: Vladimir Zapolskiy -- With best wishes, Vladimir