diff options
-rw-r--r-- | arch/sh/kernel/cpu/clock.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c index 9ded1bc29260..073f4ffe956a 100644 --- a/arch/sh/kernel/cpu/clock.c +++ b/arch/sh/kernel/cpu/clock.c | |||
@@ -415,7 +415,7 @@ struct clk *clk_get(struct device *dev, const char *id) | |||
415 | 415 | ||
416 | mutex_lock(&clock_list_sem); | 416 | mutex_lock(&clock_list_sem); |
417 | list_for_each_entry(p, &clock_list, node) { | 417 | list_for_each_entry(p, &clock_list, node) { |
418 | if (p->id == idno && | 418 | if (p->name && p->id == idno && |
419 | strcmp(id, p->name) == 0 && try_module_get(p->owner)) { | 419 | strcmp(id, p->name) == 0 && try_module_get(p->owner)) { |
420 | clk = p; | 420 | clk = p; |
421 | goto found; | 421 | goto found; |
@@ -423,7 +423,8 @@ struct clk *clk_get(struct device *dev, const char *id) | |||
423 | } | 423 | } |
424 | 424 | ||
425 | list_for_each_entry(p, &clock_list, node) { | 425 | list_for_each_entry(p, &clock_list, node) { |
426 | if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) { | 426 | if (p->name && |
427 | strcmp(id, p->name) == 0 && try_module_get(p->owner)) { | ||
427 | clk = p; | 428 | clk = p; |
428 | break; | 429 | break; |
429 | } | 430 | } |
@@ -594,7 +595,7 @@ static int clk_debugfs_register(struct clk *c) | |||
594 | return err; | 595 | return err; |
595 | } | 596 | } |
596 | 597 | ||
597 | if (!c->dentry) { | 598 | if (!c->dentry && c->name) { |
598 | err = clk_debugfs_register_one(c); | 599 | err = clk_debugfs_register_one(c); |
599 | if (err) | 600 | if (err) |
600 | return err; | 601 | return err; |