sh: Allow registering clocks without name
PATCH 5/13 sh: Allow registering clocks without name
From: Magnus Damm <[email protected]>
Stop-gap update for the SH specific clock code to allow registering clocks with name set to NULL. This code will get removed later in the patchset.
Signed-off-by Magnus Damm <[email protected]>
---
arch/sh/kernel/cpu/clock.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
arch/sh/kernel/cpu/clock.c +4 -3
@@ -415,7 +415,7 @@ struct clk *clk_get(struct device *dev,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;
@@ -423,7 +423,8 @@ struct clk *clk_get(struct device *dev, }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 ; }
@@ -594,7 +595,7 @@ static int clk_debugfs_register(struct creturn err; } -if (!c->dentry) { +if (!c->dentry && c->name) { err =clk_debugfs_register_one (c);if (err)return err;