From patchwork Mon Sep 29 14:29:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liviu Dudau X-Patchwork-Id: 38079 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 651FF201F1 for ; Mon, 29 Sep 2014 14:32:46 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf8763603eek.9 for ; Mon, 29 Sep 2014 07:32:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=kcz1bpzuyq+sVN7SmBGG9Cihdh01hlouya8r1m7jx+I=; b=AZ9hLnZ7qRdKe14pxSZcZ4ELgtp9FMm+/L3Ks46+BeNtzDKX5YNQtt9ot3eH/fUgQa iGJOfYz2DS7j/AErmwkuwIM1y0iDAXLpawF7hiMmtehWRqzuQaa39b0mTg4O2e1RRMuY eaQC8vdpvTxl+u6C79jhZ9Ah1J9OFqAUmQueb5UuwCXIhowlfuAzIMzS3z5TKAnnreBZ 1pNIe9RH7QduVwa36ACOpZ1ZAb5MbZyLvKkV5ol9pwz5vA8xhSYQG+6WC8kvfTI4DdKN jJdHk4jl+RvysIAU/Js7drUzpDAeJyBx9Ql52kvr03ntLr/gp3jr/Cnycrk7SjP2Wjm3 iWAA== X-Gm-Message-State: ALoCoQkgODXw7CtvNvkmYzLnLDktg7FCR8g82cf7uzn+wqDxzADAS+2zmnT9IRa5qmgRNjOO/Xy6 X-Received: by 10.180.221.236 with SMTP id qh12mr1746492wic.4.1412001165551; Mon, 29 Sep 2014 07:32:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.74 with SMTP id w10ls656268laj.99.gmail; Mon, 29 Sep 2014 07:32:45 -0700 (PDT) X-Received: by 10.152.36.37 with SMTP id n5mr3911969laj.93.1412001165359; Mon, 29 Sep 2014 07:32:45 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx.google.com with ESMTPS id j10si18506245laf.95.2014.09.29.07.32.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Sep 2014 07:32:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by mail-la0-f54.google.com with SMTP id gm9so428917lab.13 for ; Mon, 29 Sep 2014 07:32:43 -0700 (PDT) X-Received: by 10.112.62.200 with SMTP id a8mr37370951lbs.34.1412001163835; Mon, 29 Sep 2014 07:32:43 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp184544lbb; Mon, 29 Sep 2014 07:32:43 -0700 (PDT) X-Received: by 10.66.234.73 with SMTP id uc9mr22208852pac.55.1412001162373; Mon, 29 Sep 2014 07:32:42 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fc6si5865132pad.124.2014.09.29.07.32.40 for ; Mon, 29 Sep 2014 07:32:42 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754382AbaI2ObR (ORCPT + 27 others); Mon, 29 Sep 2014 10:31:17 -0400 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:50504 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754066AbaI2ObI (ORCPT ); Mon, 29 Sep 2014 10:31:08 -0400 Received: from e106497-lin.cambridge.arm.com (e106497-lin.cambridge.arm.com [10.1.195.53]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id s8TETVYF004719; Mon, 29 Sep 2014 15:29:34 +0100 From: Liviu Dudau To: Bjorn Helgaas , Arnd Bergmann , Rob Herring , Jason Gunthorpe , Benjamin Herrenschmidt , Catalin Marinas , Will Deacon , Russell King , linux-pci , Linus Walleij Cc: Tanmay Inamdar , Grant Likely , Sinan Kaya , Jingoo Han , Kukjin Kim , Suravee Suthikulanit , linux-arch , LKML , Device Tree ML , LAKML , Yinghai Lu , Jiang Liu Subject: [PATCH v13 04/12] of/pci: Define of_pci_range_to_resource() only when CONFIG_PCI=y Date: Mon, 29 Sep 2014 15:29:23 +0100 Message-Id: <1412000971-9242-5-git-send-email-Liviu.Dudau@arm.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1412000971-9242-1-git-send-email-Liviu.Dudau@arm.com> References: <1412000971-9242-1-git-send-email-Liviu.Dudau@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: liviu.dudau@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 */ -