Skip to content

Commit 441c244

Browse files
Magnus Dammpmundt
authored andcommitted
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>
1 parent 67bbabb commit 441c244

2 files changed

Lines changed: 2 additions & 36 deletions

File tree

‎arch/sh/include/asm/clock.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ struct clk {
2323
struct list_head node;
2424
const char *name;
2525
int id;
26-
struct module *owner;
2726

2827
struct clk *parent;
2928
struct clk_ops *ops;

‎arch/sh/kernel/cpu/clock.c‎

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -398,49 +398,16 @@ EXPORT_SYMBOL_GPL(clk_round_rate);
398398
* Returns a clock. Note that we first try to use device id on the bus
399399
* and clock name. If this fails, we try to use clock name only.
400400
*/
401-
struct clk *clk_get(struct device *dev, const char *id)
401+
struct clk *clk_get(struct device *dev, const char *con_id)
402402
{
403403
const char *dev_id = dev ? dev_name(dev) : NULL;
404-
struct clk *p, *clk = ERR_PTR(-ENOENT);
405-
int idno;
406404

407-
clk = clk_get_sys(dev_id, 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;
405+
return clk_get_sys(dev_id, con_id);
437406
}
438407
EXPORT_SYMBOL_GPL(clk_get);
439408

440409
void clk_put(struct clk *clk)
441410
{
442-
if (clk && !IS_ERR(clk))
443-
module_put(clk->owner);
444411
}
445412
EXPORT_SYMBOL_GPL(clk_put);
446413

0 commit comments

Comments
 (0)