linux-mips
[Top] [All Lists]

Re: [PATCH V7 2/4] MIPS: Add board support for Loongson1B

To: Sergei Shtylyov <sshtylyov@mvista.com>
Subject: Re: [PATCH V7 2/4] MIPS: Add board support for Loongson1B
From: Kelvin Cheung <keguang.zhang@gmail.com>
Date: Thu, 21 Jun 2012 15:37:56 +0800
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, wuzhangjin@gmail.com, zhzhl555@gmail.com
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=GwYXTsc1Upa8Fsp8dmcnBix6wk5Rmz4fKUjlEs5gcrc=; b=PiYsWAtMpEU4fpQ/77Gw6R9PVBS/zaorxSJFPKUQk6iWLmB3ZamaAlr7OZlG8RZaX1 vikK8twnUTZYaxOz4SStD17EgVmNvuh94Iw5UfcL4Pt4CFc9Cdg01cnVRTeJe9AD4WDj j/5FUFeMyYucdybK9NxYZsS/3yBLAe6qmBfSdHD9vItT9HcWNwhMPbSS31u7Hl0qnHY7 qteDggi4AKCi1cwT38RgKS0cg1xfcN7kG80sG9K5x7qsglz3L+TIOeLkrmkamZ3yPdwD 2l1dj/6zeU+rZPsXgzkhZ9ptueoj1uQ9LKQ6bhCfe60Il1RFj3sZDAWmgmM69bE7Pmm1 k4Eg==
In-reply-to: <4FE225F3.4080806@mvista.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1339757617-2187-1-git-send-email-keguang.zhang@gmail.com> <1339757617-2187-3-git-send-email-keguang.zhang@gmail.com> <20120620192551.GC29446@linux-mips.org> <4FE225F3.4080806@mvista.com>
Sender: linux-mips-bounce@linux-mips.org


2012/6/21 Sergei Shtylyov <sshtylyov@mvista.com>
Hello.


On 06/20/2012 11:25 PM, Ralf Baechle wrote:

+#include <linux/clk.h>

+static LIST_HEAD(clocks);
+static DEFINE_MUTEX(clocks_mutex);
+
+struct clk *clk_get(struct device *dev, const char *name)
+{
+       struct clk *c;
+       struct clk *ret = NULL;
+
+       mutex_lock(&clocks_mutex);
+       list_for_each_entry(c, &clocks, node) {
+               if (!strcmp(c->name, name)) {
+                       ret = c;
+                       break;
+               }
+       }
+       mutex_unlock(&clocks_mutex);
+
+       return ret;
+}
+EXPORT_SYMBOL(clk_get);

This redefines a function that already is declared in <linux/clk.h> and
defined in drivers/clk/clkdev.c.  Why?

  Because he doesn't support clkdev? clkdev support is optional.


Yes, that's what I mean.
 

+int clk_register(struct clk *clk)
+{
+       mutex_lock(&clocks_mutex);
+       list_add(&clk->node, &clocks);
+       if (clk->ops->init)
+               clk->ops->init(clk);
+       mutex_unlock(&clocks_mutex);
+
+       return 0;
+}
+EXPORT_SYMBOL(clk_register);

Same here.

  Ralf

WBR, Sergei



--
Best Regards!
Kelvin



<Prev in Thread] Current Thread [Next in Thread>