diff options
-rw-r--r-- | arch/sh/include/asm/clock.h | 1 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/clock.c | 37 |
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 | */ |
401 | struct clk *clk_get(struct device *dev, const char *id) | 401 | struct 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 | |||
433 | found: | ||
434 | mutex_unlock(&clock_list_sem); | ||
435 | |||
436 | return clk; | ||
437 | } | 406 | } |
438 | EXPORT_SYMBOL_GPL(clk_get); | 407 | EXPORT_SYMBOL_GPL(clk_get); |
439 | 408 | ||
440 | void clk_put(struct clk *clk) | 409 | void clk_put(struct clk *clk) |
441 | { | 410 | { |
442 | if (clk && !IS_ERR(clk)) | ||
443 | module_put(clk->owner); | ||
444 | } | 411 | } |
445 | EXPORT_SYMBOL_GPL(clk_put); | 412 | EXPORT_SYMBOL_GPL(clk_put); |
446 | 413 | ||