diff options
author | Dario Binacchi <dariobin@libero.it> | 2020-05-02 17:38:11 +0200 |
---|---|---|
committer | Lukasz Majewski <lukma@denx.de> | 2020-08-24 11:03:26 +0200 |
commit | 7b0830d41f9e0350207ae3f5137ad8c50731374b (patch) | |
tree | 23e3aff932a96c6918d1fca7b0f8efccd1b72516 /drivers/clk/clk.c | |
parent | 16bdc85b488dd2f9463a71d6aa09bdf5ea9a9978 (diff) | |
download | u-boot-7b0830d41f9e0350207ae3f5137ad8c50731374b.zip u-boot-7b0830d41f9e0350207ae3f5137ad8c50731374b.tar.gz u-boot-7b0830d41f9e0350207ae3f5137ad8c50731374b.tar.bz2 |
clk: fix the console output of clk_register
The parent->name variable can be used only in case the
uclass_get_device_by_name routine returns successfully.
Signed-off-by: Dario Binacchi <dariobin@libero.it>
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r-- | drivers/clk/clk.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 0f55ba7..786f4e8 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -22,13 +22,13 @@ int clk_register(struct clk *clk, const char *drv_name, ret = uclass_get_device_by_name(UCLASS_CLK, parent_name, &parent); if (ret) { - printf("%s: name: %s parent: %s [0x%p]\n", - __func__, name, parent->name, parent); + printf("%s: failed to get %s device (parent of %s)\n", + __func__, parent_name, name); + } else { + debug("%s: name: %s parent: %s [0x%p]\n", __func__, name, + parent->name, parent); } - debug("%s: name: %s parent: %s [0x%p]\n", __func__, name, parent->name, - parent); - drv = lists_driver_lookup_name(drv_name); if (!drv) { printf("%s: %s is not a valid driver name\n", |