Message ID | 20211023164831.25690-1-jason-jh.lin@mediatek.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | mailbox: remove the error message when gce clk is defer | expand |
On Sun, Oct 24, 2021 at 12:48:31AM +0800, jason-jh.lin wrote: > Remove the error message when gce clk is defer. > > Signed-off-by: jason-jh.lin <jason-jh.lin@mediatek.com> > --- > drivers/mailbox/mtk-cmdq-mailbox.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c > index fd5576a9f8b4..684b8aa1e445 100644 > --- a/drivers/mailbox/mtk-cmdq-mailbox.c > +++ b/drivers/mailbox/mtk-cmdq-mailbox.c > @@ -577,7 +577,8 @@ static int cmdq_probe(struct platform_device *pdev) > snprintf(clk_id, sizeof(clk_id), "%s%d", clk_name, alias_id); > cmdq->clocks[alias_id].id = clk_id; > cmdq->clocks[alias_id].clk = of_clk_get(node, 0); > - if (IS_ERR(cmdq->clocks[alias_id].clk)) { > + if (IS_ERR(cmdq->clocks[alias_id].clk) && > + PTR_ERR(cmdq->clocks[alias_id].clk) != -EPROBE_DEFER) { > dev_err(dev, "failed to get gce clk: %d\n", alias_id); > return PTR_ERR(cmdq->clocks[alias_id].clk); > } So when you get -EPROBE_DEFER, you omit the error message _and_ ignore the -EPROBE_DEFER. Is that really what you want to do?
Hi Russell, Thanks for the reviews. On Sun, 2021-10-24 at 21:25 +0100, Russell King (Oracle) wrote: > On Sun, Oct 24, 2021 at 12:48:31AM +0800, jason-jh.lin wrote: > > Remove the error message when gce clk is defer. > > > > Signed-off-by: jason-jh.lin <jason-jh.lin@mediatek.com> > > --- > > drivers/mailbox/mtk-cmdq-mailbox.c | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c > > b/drivers/mailbox/mtk-cmdq-mailbox.c > > index fd5576a9f8b4..684b8aa1e445 100644 > > --- a/drivers/mailbox/mtk-cmdq-mailbox.c > > +++ b/drivers/mailbox/mtk-cmdq-mailbox.c > > @@ -577,7 +577,8 @@ static int cmdq_probe(struct platform_device > > *pdev) > > snprintf(clk_id, sizeof(clk_id), > > "%s%d", clk_name, alias_id); > > cmdq->clocks[alias_id].id = clk_id; > > cmdq->clocks[alias_id].clk = > > of_clk_get(node, 0); > > - if (IS_ERR(cmdq->clocks[alias_id].clk)) > > { > > + if (IS_ERR(cmdq->clocks[alias_id].clk) > > && > > + PTR_ERR(cmdq->clocks[alias_id].clk) > > != -EPROBE_DEFER) { > > dev_err(dev, "failed to get gce > > clk: %d\n", alias_id); > > return PTR_ERR(cmdq- > > >clocks[alias_id].clk); > > } > > So when you get -EPROBE_DEFER, you omit the error message _and_ > ignore > the -EPROBE_DEFER. Is that really what you want to do? > Oh, you're right. I should return the -EPROBE_DEFER. I just want to ignore the error msg because gce clk may not ready while gce probing. I'll update this patch at next version.
diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c index fd5576a9f8b4..684b8aa1e445 100644 --- a/drivers/mailbox/mtk-cmdq-mailbox.c +++ b/drivers/mailbox/mtk-cmdq-mailbox.c @@ -577,7 +577,8 @@ static int cmdq_probe(struct platform_device *pdev) snprintf(clk_id, sizeof(clk_id), "%s%d", clk_name, alias_id); cmdq->clocks[alias_id].id = clk_id; cmdq->clocks[alias_id].clk = of_clk_get(node, 0); - if (IS_ERR(cmdq->clocks[alias_id].clk)) { + if (IS_ERR(cmdq->clocks[alias_id].clk) && + PTR_ERR(cmdq->clocks[alias_id].clk) != -EPROBE_DEFER) { dev_err(dev, "failed to get gce clk: %d\n", alias_id); return PTR_ERR(cmdq->clocks[alias_id].clk); } @@ -586,7 +587,8 @@ static int cmdq_probe(struct platform_device *pdev) } else { 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)) { + if (IS_ERR(cmdq->clocks[alias_id].clk) && + PTR_ERR(cmdq->clocks[alias_id].clk) != -EPROBE_DEFER) { dev_err(dev, "failed to get gce clk\n"); return PTR_ERR(cmdq->clocks[alias_id].clk); }
Remove the error message when gce clk is defer. Signed-off-by: jason-jh.lin <jason-jh.lin@mediatek.com> --- drivers/mailbox/mtk-cmdq-mailbox.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)