clk: bulk: Use dev_err_probe() helper in __clk_bulk_get()
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 13 Sep 2022 03:24:03 +0000 (11:24 +0800)
committerStephen Boyd <sboyd@kernel.org>
Mon, 17 Oct 2022 23:07:51 +0000 (16:07 -0700)
dev_err() can be replace with dev_err_probe() which will check if error
code is -EPROBE_DEFER.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220913032403.1007902-1-yangyingliang@huawei.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-bulk.c

index e9e1642..826b3ff 100644 (file)
@@ -96,9 +96,9 @@ static int __clk_bulk_get(struct device *dev, int num_clks,
                        if (ret == -ENOENT && optional)
                                continue;
 
-                       if (ret != -EPROBE_DEFER)
-                               dev_err(dev, "Failed to get clk '%s': %d\n",
-                                       clks[i].id, ret);
+                       dev_err_probe(dev, ret,
+                                     "Failed to get clk '%s'\n",
+                                     clks[i].id);
                        goto err;
                }
        }