From patchwork Mon Jul 16 21:46:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 1202521 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id AD00FE0038 for ; Mon, 16 Jul 2012 21:56:14 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SqtDs-0000NE-99; Mon, 16 Jul 2012 21:52:56 +0000 Received: from mail-ob0-f177.google.com ([209.85.214.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SqtDH-0000Jn-O3 for linux-arm-kernel@lists.infradead.org; Mon, 16 Jul 2012 21:52:21 +0000 Received: by obbta17 with SMTP id ta17so10464292obb.36 for ; Mon, 16 Jul 2012 14:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=CEXvWpPNoCWKemHtLEoxEqwJ3e4aNCRXntjMjXTcjBQ=; b=zMSEhH02keGSJF6TlbaskSsu8SUb5rDPcwbMXHwUeb37GBTPjnTFn4c+qFwuCYDGJs BgMJgmjOpDFORuzdbGbuHWNip3wh06j9j1DmfbyZCrZKbRZqfxdaGlb8PvcRCIjE3S/o xAcUlQkTP4KGkq0x9cCqthn6TabsiO211z2BPBhMX5hGwrrCc/25QCiRKyo5NvlSVo9u y0gDVMCqWCZzt47AVCjoaPhCT2opRwgNM5xsf//tYOh/Mu0Nk6sA9MFkL+S8FaZxVOn2 bkS/q+4SnADU6aB6HJfMKRJohHNs+9pOiD3p4wAnxxjr0+bCScUDjP6YeuZe3SK+wQvX SY2w== Received: by 10.60.2.3 with SMTP id 3mr80281oeq.0.1342475178092; Mon, 16 Jul 2012 14:46:18 -0700 (PDT) Received: from rob-laptop.calxeda.com (65-36-72-55.dyn.grandenetworks.net. [65.36.72.55]) by mx.google.com with ESMTPS id l10sm10411914oeb.13.2012.07.16.14.46.16 (version=SSLv3 cipher=OTHER); Mon, 16 Jul 2012 14:46:17 -0700 (PDT) From: Rob Herring To: mturquette@ti.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] clk: fix compile for OF && !COMMON_CLK Date: Mon, 16 Jul 2012 16:46:01 -0500 Message-Id: <1342475161-20402-1-git-send-email-robherring2@gmail.com> X-Mailer: git-send-email 1.7.9.5 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robherring2[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (robherring2[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Prashant Gaikwad , Rob Herring , aletes.xgr@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Rob Herring With commit 766e6a4ec602d0c107 (clk: add DT clock binding support), compiling with OF && !COMMON_CLK is broken. Reported-by: Alexandre Pereira da Silva Reported-by: Prashant Gaikwad Signed-off-by: Rob Herring --- drivers/clk/clkdev.c | 2 +- include/linux/clk.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index 20649b3..8f87b0f 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c @@ -24,7 +24,7 @@ static LIST_HEAD(clocks); static DEFINE_MUTEX(clocks_mutex); -#ifdef CONFIG_OF +#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK) struct clk *of_clk_get(struct device_node *np, int index) { struct of_phandle_args clkspec; diff --git a/include/linux/clk.h b/include/linux/clk.h index 8b70342..35f7492 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -12,6 +12,7 @@ #ifndef __LINUX_CLK_H #define __LINUX_CLK_H +#include #include #include @@ -313,19 +314,19 @@ int clk_add_alias(const char *alias, const char *alias_dev_name, char *id, struct device_node; struct of_phandle_args; -#ifdef CONFIG_OF +#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK) struct clk *of_clk_get(struct device_node *np, int index); struct clk *of_clk_get_by_name(struct device_node *np, const char *name); struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec); #else static inline struct clk *of_clk_get(struct device_node *np, int index) { - return NULL; + return ERR_PTR(-EINVAL); } static inline struct clk *of_clk_get_by_name(struct device_node *np, const char *name) { - return NULL; + return ERR_PTR(-EINVAL); } #endif