summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/clock.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-21 16:19:34 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-21 16:19:34 -0800
commit06165752c8dfd7c6a3f3186bd6dec86a70895c72 (patch)
treeb8bfcd0ec0a61ec187fc67d941f9200a3a3c5f0d /arch/arm/mach-pxa/clock.c
parent597592d951cdca8e5edb29f7e8174f633a69685a (diff)
parent717a54ad6cb4b1782a26ae0eaebc8bd49c56c66e (diff)
downloadop-kernel-dev-06165752c8dfd7c6a3f3186bd6dec86a70895c72.zip
op-kernel-dev-06165752c8dfd7c6a3f3186bd6dec86a70895c72.tar.gz
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: [ARM] 4835/1: Fix stale comment in struct machine_desc description [ARM] 4829/1: add .get method to pxa-cpufreq to silence a warning [ARM] 4828/1: fix 3 warnings in drivers/video/pxafb.c [ARM] 4827/1: fix two warnings in drivers/i2c/busses/i2c-pxa.c [ARM] 4826/1: Orion: Register the RTC interrupt on the TS-209 [ARM] pxa: fix clock lookup to find specific device clocks
Diffstat (limited to 'arch/arm/mach-pxa/clock.c')
-rw-r--r--arch/arm/mach-pxa/clock.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c
index 83ef5ec..df5ae27 100644
--- a/arch/arm/mach-pxa/clock.c
+++ b/arch/arm/mach-pxa/clock.c
@@ -23,18 +23,27 @@ static LIST_HEAD(clocks);
static DEFINE_MUTEX(clocks_mutex);
static DEFINE_SPINLOCK(clocks_lock);
+static struct clk *clk_lookup(struct device *dev, const char *id)
+{
+ struct clk *p;
+
+ list_for_each_entry(p, &clocks, node)
+ if (strcmp(id, p->name) == 0 && p->dev == dev)
+ return p;
+
+ return NULL;
+}
+
struct clk *clk_get(struct device *dev, const char *id)
{
struct clk *p, *clk = ERR_PTR(-ENOENT);
mutex_lock(&clocks_mutex);
- list_for_each_entry(p, &clocks, node) {
- if (strcmp(id, p->name) == 0 &&
- (p->dev == NULL || p->dev == dev)) {
- clk = p;
- break;
- }
- }
+ p = clk_lookup(dev, id);
+ if (!p)
+ p = clk_lookup(NULL, id);
+ if (p)
+ clk = p;
mutex_unlock(&clocks_mutex);
return clk;
OpenPOWER on IntegriCloud