From mboxrd@z Thu Jan 1 00:00:00 1970 From: Liviu.Dudau@arm.com (Liviu Dudau) Date: Mon, 29 Sep 2014 15:29:23 +0100 Subject: [PATCH v13 04/12] of/pci: Define of_pci_range_to_resource() only when CONFIG_PCI=y In-Reply-To: <1412000971-9242-1-git-send-email-Liviu.Dudau@arm.com> References: <1412000971-9242-1-git-send-email-Liviu.Dudau@arm.com> Message-ID: <1412000971-9242-5-git-send-email-Liviu.Dudau@arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org From: Bjorn Helgaas of_pci_range_to_resource() was previously defined always, but it's only used by PCI code, so move the definition inside the CONFIG_OF_ADDRESS && CONFIG_PCI block. Signed-off-by: Bjorn Helgaas --- include/linux/of_address.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/linux/of_address.h b/include/linux/of_address.h index f8cc7da..ecf913c 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h @@ -23,17 +23,6 @@ struct of_pci_range { #define for_each_of_pci_range(parser, range) \ for (; of_pci_range_parser_one(parser, range);) -static inline void of_pci_range_to_resource(struct of_pci_range *range, - struct device_node *np, - struct resource *res) -{ - res->flags = range->flags; - res->start = range->cpu_addr; - res->end = range->cpu_addr + range->size - 1; - res->parent = res->child = res->sibling = NULL; - res->name = np->full_name; -} - /* Translate a DMA address from device space to CPU space */ extern u64 of_translate_dma_address(struct device_node *dev, const __be32 *in_addr); @@ -140,6 +129,18 @@ extern const __be32 *of_get_pci_address(struct device_node *dev, int bar_no, u64 *size, unsigned int *flags); extern int of_pci_address_to_resource(struct device_node *dev, int bar, struct resource *r); + +static inline void of_pci_range_to_resource(struct of_pci_range *range, + struct device_node *np, + struct resource *res) +{ + res->flags = range->flags; + res->start = range->cpu_addr; + res->end = range->cpu_addr + range->size - 1; + res->parent = res->child = res->sibling = NULL; + res->name = np->full_name; +} + #else /* CONFIG_OF_ADDRESS && CONFIG_PCI */ static inline int of_pci_address_to_resource(struct device_node *dev, int bar, struct resource *r) @@ -155,4 +156,3 @@ static inline const __be32 *of_get_pci_address(struct device_node *dev, #endif /* CONFIG_OF_ADDRESS && CONFIG_PCI */ #endif /* __OF_ADDRESS_H */ - -- 2.1.1