clk: show more error info when uclass_get_device_by_name
authorPeng Fan <peng.fan@nxp.com>
Tue, 22 Oct 2019 03:31:08 +0000 (03:31 +0000)
committerLukasz Majewski <lukma@denx.de>
Sun, 26 Jan 2020 11:03:06 +0000 (12:03 +0100)
It will ease debug when uclass_get_device_by_name failed with
more error info printed out.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/clk/clk.c

index 1cf9987f6cbb8d87ca69d08ee1c361c62f8ee78f..4c477a488e14fec0d625982ebec96ec84061edc7 100644 (file)
@@ -20,8 +20,10 @@ int clk_register(struct clk *clk, const char *drv_name,
        int ret;
 
        ret = uclass_get_device_by_name(UCLASS_CLK, parent_name, &parent);
-       if (ret)
-               printf("%s: UCLASS parent: 0x%p\n", __func__, parent);
+       if (ret) {
+               printf("%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);