diff mbox

clk: clk-conf: Do not print error messages if EPROBE_DEFER

Message ID 1483524753-32213-1-git-send-email-geert+renesas@glider.be (mailing list archive)
State Accepted
Delegated to: Stephen Boyd
Headers show

Commit Message

Geert Uytterhoeven Jan. 4, 2017, 10:12 a.m. UTC
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>
---
 drivers/clk/clk-conf.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

Comments

Marek Vasut Jan. 4, 2017, 12:39 p.m. UTC | #1
On 01/04/2017 11:12 AM, Geert Uytterhoeven wrote:
> 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: Marek Vasut <marek.vasut@gmail.com>

> ---
>  drivers/clk/clk-conf.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/clk/clk-conf.c b/drivers/clk/clk-conf.c
> index 674785d968a3e1c5..e0e02a6e59009e7a 100644
> --- a/drivers/clk/clk-conf.c
> +++ b/drivers/clk/clk-conf.c
> @@ -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);
>  			}
>  
>
Javier Martinez Canillas Jan. 4, 2017, 8:43 p.m. UTC | #2
Hello Geert,

On Wed, Jan 4, 2017 at 7:12 AM, Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
> 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>

Best regards,
Javier
--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stephen Boyd Jan. 10, 2017, 12:09 a.m. UTC | #3
On 01/04, Geert Uytterhoeven wrote:
> 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>
> ---

Applied to clk-next
diff mbox

Patch

diff --git a/drivers/clk/clk-conf.c b/drivers/clk/clk-conf.c
index 674785d968a3e1c5..e0e02a6e59009e7a 100644
--- a/drivers/clk/clk-conf.c
+++ b/drivers/clk/clk-conf.c
@@ -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);
 			}