aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2010-05-11 05:37:12 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-05-13 04:38:16 -0400
commit441c2440aba2efd8d0f48a5e3357deec92283d62 (patch)
treec5e4b5551125118c482c0c8da828808412c778d9 /arch/sh
parent67bbabbc8680f53c7b8780d991f655c5cbb88700 (diff)
sh: remove unused clock lookup
Now when all clocks are registered using clkdev, get rid of the special SH-specific clock lookup. Also ditch the unused module ref counting code. This patch syncs the SH behaviour with ARM. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/include/asm/clock.h1
-rw-r--r--arch/sh/kernel/cpu/clock.c37
2 files changed, 2 insertions, 36 deletions
diff --git a/arch/sh/include/asm/clock.h b/arch/sh/include/asm/clock.h
index f6b0bfd4e191..35d219616110 100644
--- a/arch/sh/include/asm/clock.h
+++ b/arch/sh/include/asm/clock.h
@@ -23,7 +23,6 @@ struct clk {
23 struct list_head node; 23 struct list_head node;
24 const char *name; 24 const char *name;
25 int id; 25 int id;
26 struct module *owner;
27 26
28 struct clk *parent; 27 struct clk *parent;
29 struct clk_ops *ops; 28 struct clk_ops *ops;
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c
index a725c7feb747..8cc6935d91ae 100644
--- a/arch/sh/kernel/cpu/clock.c
+++ b/arch/sh/kernel/cpu/clock.c
@@ -398,49 +398,16 @@ EXPORT_SYMBOL_GPL(clk_round_rate);
398 * Returns a clock. Note that we first try to use device id on the bus 398 * Returns a clock. Note that we first try to use device id on the bus
399 * and clock name. If this fails, we try to use clock name only. 399 * and clock name. If this fails, we try to use clock name only.
400 */ 400 */
401struct clk *clk_get(struct device *dev, const char *id) 401struct clk *clk_get(struct device *dev, const char *con_id)
402{ 402{
403 const char *dev_id = dev ? dev_name(dev) : NULL; 403 const char *dev_id = dev ? dev_name(dev) : NULL;
404 struct clk *p, *clk = ERR_PTR(-ENOENT);
405 int idno;
406 404
407 clk = clk_get_sys(dev_id, id); 405 return clk_get_sys(dev_id, con_id);
408 if (clk && !IS_ERR(clk))
409 return clk;
410
411 if (dev == NULL || dev->bus != &platform_bus_type)
412 idno = -1;
413 else
414 idno = to_platform_device(dev)->id;
415
416 mutex_lock(&clock_list_sem);
417 list_for_each_entry(p, &clock_list, node) {
418 if (p->name && p->id == idno &&
419 strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
420 clk = p;
421 goto found;
422 }
423 }
424
425 list_for_each_entry(p, &clock_list, node) {
426 if (p->name &&
427 strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
428 clk = p;
429 break;
430 }
431 }
432
433found:
434 mutex_unlock(&clock_list_sem);
435
436 return clk;
437} 406}
438EXPORT_SYMBOL_GPL(clk_get); 407EXPORT_SYMBOL_GPL(clk_get);
439 408
440void clk_put(struct clk *clk) 409void clk_put(struct clk *clk)
441{ 410{
442 if (clk && !IS_ERR(clk))
443 module_put(clk->owner);
444} 411}
445EXPORT_SYMBOL_GPL(clk_put); 412EXPORT_SYMBOL_GPL(clk_put);
446 413