diff mbox series

mailbox: mtk-cmdq: Silent EPROBE_DEFER errors for clks

Message ID 20211209065948.1796663-1-hsinyi@chromium.org (mailing list archive)
State New, archived
Headers show
Series mailbox: mtk-cmdq: Silent EPROBE_DEFER errors for clks | expand

Commit Message

Hsin-Yi Wang Dec. 9, 2021, 6:59 a.m. UTC
Silent the error if it's EPROBE_DEFER for clks.

Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
---
 drivers/mailbox/mtk-cmdq-mailbox.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

AngeloGioacchino Del Regno Dec. 9, 2021, 2:52 p.m. UTC | #1
Il 09/12/21 07:59, Hsin-Yi Wang ha scritto:
> Silent the error if it's EPROBE_DEFER for clks.
> 
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> ---
>   drivers/mailbox/mtk-cmdq-mailbox.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 

Hello! Thanks for the patch!
However, there's something to improve...

> diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
> index a8845b162dbf..087fb7334166 100644
> --- a/drivers/mailbox/mtk-cmdq-mailbox.c
> +++ b/drivers/mailbox/mtk-cmdq-mailbox.c
> @@ -573,7 +573,10 @@ static int cmdq_probe(struct platform_device *pdev)
>   				cmdq->clocks[alias_id].id = clk_names[alias_id];
>   				cmdq->clocks[alias_id].clk = of_clk_get(node, 0);
>   				if (IS_ERR(cmdq->clocks[alias_id].clk)) {
> -					dev_err(dev, "failed to get gce clk: %d\n", alias_id);
> +					dev_err_probe(dev,
> +						PTR_ERR(cmdq->clocks[alias_id].clk),
> +						"failed to get gce clk: %d\n",
> +						alias_id);

You can just return dev_err_probe(...)

>   					return PTR_ERR(cmdq->clocks[alias_id].clk);

...so this return gets removed.

>   				}
>   			}
> @@ -582,7 +585,8 @@ static int cmdq_probe(struct platform_device *pdev)
>   		cmdq->clocks[alias_id].id = clk_name;
>   		cmdq->clocks[alias_id].clk = devm_clk_get(&pdev->dev, clk_name);
>   		if (IS_ERR(cmdq->clocks[alias_id].clk)) {
> -			dev_err(dev, "failed to get gce clk\n");
> +			dev_err_probe(dev, PTR_ERR(cmdq->clocks[alias_id].clk),
> +				"failed to get gce clk\n");
>   			return PTR_ERR(cmdq->clocks[alias_id].clk);

Same here:
return dev_err_probe(dev, PTR_ERR(cmdq->clocks[alias_id].clk),
		     "failed to get gce clk\n");

>   		}
>   	}
> 

Regards,
- Angelo
diff mbox series

Patch

diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
index a8845b162dbf..087fb7334166 100644
--- a/drivers/mailbox/mtk-cmdq-mailbox.c
+++ b/drivers/mailbox/mtk-cmdq-mailbox.c
@@ -573,7 +573,10 @@  static int cmdq_probe(struct platform_device *pdev)
 				cmdq->clocks[alias_id].id = clk_names[alias_id];
 				cmdq->clocks[alias_id].clk = of_clk_get(node, 0);
 				if (IS_ERR(cmdq->clocks[alias_id].clk)) {
-					dev_err(dev, "failed to get gce clk: %d\n", alias_id);
+					dev_err_probe(dev,
+						PTR_ERR(cmdq->clocks[alias_id].clk),
+						"failed to get gce clk: %d\n",
+						alias_id);
 					return PTR_ERR(cmdq->clocks[alias_id].clk);
 				}
 			}
@@ -582,7 +585,8 @@  static int cmdq_probe(struct platform_device *pdev)
 		cmdq->clocks[alias_id].id = clk_name;
 		cmdq->clocks[alias_id].clk = devm_clk_get(&pdev->dev, clk_name);
 		if (IS_ERR(cmdq->clocks[alias_id].clk)) {
-			dev_err(dev, "failed to get gce clk\n");
+			dev_err_probe(dev, PTR_ERR(cmdq->clocks[alias_id].clk),
+				"failed to get gce clk\n");
 			return PTR_ERR(cmdq->clocks[alias_id].clk);
 		}
 	}