summaryrefslogtreecommitdiff
path: root/drivers/clk
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2015-10-20 11:49:44 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2015-10-20 17:24:08 +0100
commit625faa6a720d26fc0db9e20b48dc0dfe4c8d8ddf (patch)
treea9d0f9a0a352dace47c61240bde0ee98f190c15f /drivers/clk
parent8a603f91cc4848ab1a0458bc065aa9f64322e123 (diff)
clkdev: fix clk_add_alias() with a NULL alias device name
clk_add_alias() was not correctly handling the case where alias_dev_name was NULL: rather than producing an entry with a NULL dev_id pointer, it would produce a device name of (null). Fix this. Cc: <stable@vger.kernel.org> Fixes: 2568999835d7 ("clkdev: add clkdev_create() helper") Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/clkdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index c0eaf0973bd2..779b6ff0c7ad 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -333,7 +333,8 @@ int clk_add_alias(const char *alias, const char *alias_dev_name,
if (IS_ERR(r))
return PTR_ERR(r);
- l = clkdev_create(r, alias, "%s", alias_dev_name);
+ l = clkdev_create(r, alias, alias_dev_name ? "%s" : NULL,
+ alias_dev_name);
clk_put(r);
return l ? 0 : -ENODEV;