clk: clk-conf: Do not print error messages if EPROBE_DEFER
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 4 Jan 2017 10:12:33 +0000 (11:12 +0100)
committerStephen Boyd <sboyd@codeaurora.org>
Tue, 10 Jan 2017 00:09:05 +0000 (16:09 -0800)
EPROBE_DEFER is not an error, hence printing an error message like

clk: couldn't get clock 0 for /soc/display@feb00000

may confuse the user.

Suppress error messages in case of probe deferral to fix this.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/clk-conf.c

index 674785d968a3e1c507637ebbeb3865e17fcb5def..e0e02a6e59009e7ac56ae85ddaecc8624568e5b3 100644 (file)
@@ -40,8 +40,9 @@ static int __set_clk_parents(struct device_node *node, bool clk_supplier)
                        return 0;
                pclk = of_clk_get_from_provider(&clkspec);
                if (IS_ERR(pclk)) {
-                       pr_warn("clk: couldn't get parent clock %d for %s\n",
-                               index, node->full_name);
+                       if (PTR_ERR(pclk) != -EPROBE_DEFER)
+                               pr_warn("clk: couldn't get parent clock %d for %s\n",
+                                       index, node->full_name);
                        return PTR_ERR(pclk);
                }
 
@@ -55,8 +56,9 @@ static int __set_clk_parents(struct device_node *node, bool clk_supplier)
                }
                clk = of_clk_get_from_provider(&clkspec);
                if (IS_ERR(clk)) {
-                       pr_warn("clk: couldn't get assigned clock %d for %s\n",
-                               index, node->full_name);
+                       if (PTR_ERR(clk) != -EPROBE_DEFER)
+                               pr_warn("clk: couldn't get assigned clock %d for %s\n",
+                                       index, node->full_name);
                        rc = PTR_ERR(clk);
                        goto err;
                }
@@ -99,8 +101,9 @@ static int __set_clk_rates(struct device_node *node, bool clk_supplier)
 
                        clk = of_clk_get_from_provider(&clkspec);
                        if (IS_ERR(clk)) {
-                               pr_warn("clk: couldn't get clock %d for %s\n",
-                                       index, node->full_name);
+                               if (PTR_ERR(clk) != -EPROBE_DEFER)
+                                       pr_warn("clk: couldn't get clock %d for %s\n",
+                                               index, node->full_name);
                                return PTR_ERR(clk);
                        }