From patchwork Sun Mar 25 15:02:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas.abraham@linaro.org X-Patchwork-Id: 7453 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 8835723E2F for ; Sun, 25 Mar 2012 14:57:55 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 50AFBA180D3 for ; Sun, 25 Mar 2012 14:57:55 +0000 (UTC) Received: by iage36 with SMTP id e36so9293907iag.11 for ; Sun, 25 Mar 2012 07:57:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-forwarded-to:x-forwarded-for:delivered-to :received-spf:x-auditid:from:to:cc:subject:date:message-id:x-mailer :x-brightmail-tracker:x-tm-as-mml:x-gm-message-state; bh=tlzYak0oqoDxEoku/nWK+Z6/pLEw3G9Z30G3Mb28ack=; b=mWWccNLofv5pyUJ3jG68X6ZEvfcFJPywY6/HzrCxEYmjDq6bdUPnW1q5VUP0flOwlf H/1dX0EC0pl4h6OgjCRYY84bMgLvgFrKOURImZzGTnTAVaRWaSdE5nKGNAN8lPYIsUxp EnwSt1Es6lepq+pOTxt7O3Cx5S+UnTCb+Xxly26oXIIsjcUVXj+VGKyI0iv/KqEeYz8Y AVO47NADN5qohbyDHlmGyEmbggyKqi6PG1jbjfqDq5L5JZs7vYWmqMM2Wmyl0dE9icnh /eks55n9zxOe8vo07qT6kyRhTl2Okug7k9PHv/SX0xSdAJjazLkggnMWAzsd4o5+Keit O4UQ== MIME-Version: 1.0 Received: by 10.50.214.36 with SMTP id nx4mr3496161igc.2.1332687474762; Sun, 25 Mar 2012 07:57:54 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.203.79 with SMTP id fh15csp69024ibb; Sun, 25 Mar 2012 07:57:54 -0700 (PDT) Received: by 10.68.216.6 with SMTP id om6mr46019435pbc.117.1332687473684; Sun, 25 Mar 2012 07:57:53 -0700 (PDT) Received: from mailout2.samsung.com (mailout2.samsung.com. [203.254.224.25]) by mx.google.com with ESMTP id p7si15478848pbk.254.2012.03.25.07.57.53; Sun, 25 Mar 2012 07:57:53 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.25 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.25; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.25 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm1.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0M1G00LEA48GFB30@mailout2.samsung.com> for patches@linaro.org; Sun, 25 Mar 2012 23:57:52 +0900 (KST) X-AuditID: cbfee61a-b7c49ae0000061d4-2f-4f6f3270117f Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id 12.BB.25044.0723F6F4; Sun, 25 Mar 2012 23:57:52 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp2.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTPA id <0M1G00I6C48BVZ10@mmp2.samsung.com> for patches@linaro.org; Sun, 25 Mar 2012 23:57:52 +0900 (KST) From: Thomas Abraham To: devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: rob.herring@calxeda.com, grant.likely@secretlab.ca, linux-samsung-soc@vger.kernel.org, patches@linaro.org Subject: [PATCH v2] of/irq: add empty irq_of_parse_and_map() for non-dt builds Date: Sun, 25 Mar 2012 20:32:49 +0530 Message-id: <1332687769-3127-1-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 X-Brightmail-Tracker: AAAAAA== X-TM-AS-MML: No X-Gm-Message-State: ALoCoQl4W1WwOUVmUvNm3jPA+jFz/qPTlylLf0V8cMKC34veWFp/F2KWa05wCWRWu8igarL+LGFJ Add a empty irq_of_parse_and_map() function that returns 0 for non-dt builds and avoid having #ifdef CONFIG_OF around all calls to irq_of_parse_and_map(). In addition to that, the irq_of_parse_and_map() function declaration is made available only if CONFIG_OF_IRQ is defined, which is the same config option that makes the irq_of_parse_and_map() function definition available. While at it, fix a typo as well. Suggested-by: Grant Likely Signed-off-by: Thomas Abraham Acked-by: Rob Herring Acked-by: Grant Likely --- Changes since v1: - Moved irq_of_parse_and_map() function declaration under CONFIG_OF_IRQ. - Fix a minor typo in comments. include/linux/of_irq.h | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index d229ad3..11d57e4 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h @@ -10,14 +10,14 @@ struct of_irq; #include #include +#if defined(CONFIG_OF_IRQ) /* - * irq_of_parse_and_map() is used ba all OF enabled platforms; but SPARC + * irq_of_parse_and_map() is used by all OF enabled platforms; but SPARC * implements it differently. However, the prototype is the same for all, * so declare it here regardless of the CONFIG_OF_IRQ setting. */ extern unsigned int irq_of_parse_and_map(struct device_node *node, int index); -#if defined(CONFIG_OF_IRQ) /** * of_irq - container for device_node/irq_specifier pair for an irq controller * @controller: pointer to interrupt controller device tree node @@ -76,5 +76,11 @@ extern struct device_node *of_irq_find_parent(struct device_node *child); extern void of_irq_init(const struct of_device_id *matches); #endif /* CONFIG_OF_IRQ */ +#else /* CONFIG_OF */ +static inline unsigned int irq_of_parse_and_map(struct device_node *dev, + int index) +{ + return 0; +} #endif /* CONFIG_OF */ #endif /* __OF_IRQ_H */