Skip to content

Commit

Permalink
sh: allow registering clocks without name
Browse files Browse the repository at this point in the history
Modify the SuperH clock code to support struct clk
with NULL as name. Such clocks will not be hooked
up to debugfs.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Magnus Damm authored and Paul Mundt committed May 11, 2010
1 parent fd30401 commit d97432f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions arch/sh/kernel/cpu/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,15 +415,16 @@ struct clk *clk_get(struct device *dev, const char *id)

mutex_lock(&clock_list_sem);
list_for_each_entry(p, &clock_list, node) {
if (p->id == idno &&
if (p->name && p->id == idno &&
strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
clk = p;
goto found;
}
}

list_for_each_entry(p, &clock_list, node) {
if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
if (p->name &&
strcmp(id, p->name) == 0 && try_module_get(p->owner)) {
clk = p;
break;
}
Expand Down Expand Up @@ -594,7 +595,7 @@ static int clk_debugfs_register(struct clk *c)
return err;
}

if (!c->dentry) {
if (!c->dentry && c->name) {
err = clk_debugfs_register_one(c);
if (err)
return err;
Expand Down

0 comments on commit d97432f

Please sign in to comment.