diff mbox

[5/6] devfreq: rk3399_dmc: do not print error when get supply and clk defer.

Message ID 20180419104019.24406-6-enric.balletbo@collabora.com (mailing list archive)
State Deferred
Headers show

Commit Message

Enric Balletbo i Serra April 19, 2018, 10:40 a.m. UTC
From: Lin Huang <hl@rock-chips.com>

We just return -EPROBE_DEFER error code to caller and do not
print error message when try to get center logic regulator
and DMC clock defer.

Signed-off-by: Lin Huang <hl@rock-chips.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---

 drivers/devfreq/rk3399_dmc.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Ulf Hansson April 23, 2018, 10:44 a.m. UTC | #1
On 19 April 2018 at 12:40, Enric Balletbo i Serra
<enric.balletbo@collabora.com> wrote:
> From: Lin Huang <hl@rock-chips.com>
>
> We just return -EPROBE_DEFER error code to caller and do not
> print error message when try to get center logic regulator
> and DMC clock defer.
>
> Signed-off-by: Lin Huang <hl@rock-chips.com>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
>
>  drivers/devfreq/rk3399_dmc.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c
> index 44a379657cd5..5bfca028eaaf 100644
> --- a/drivers/devfreq/rk3399_dmc.c
> +++ b/drivers/devfreq/rk3399_dmc.c
> @@ -308,12 +308,18 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
>
>         data->vdd_center = devm_regulator_get(dev, "center");
>         if (IS_ERR(data->vdd_center)) {
> +               if (PTR_ERR(data->vdd_center) == -EPROBE_DEFER)
> +                       return -EPROBE_DEFER;
> +
>                 dev_err(dev, "Cannot get the regulator \"center\"\n");

Doesn't the clock core already print an error message for this?

Maybe a better way is simply to drop the printing instead of trying to
have a special case for it?

>                 return PTR_ERR(data->vdd_center);
>         }
>
>         data->dmc_clk = devm_clk_get(dev, "dmc_clk");
>         if (IS_ERR(data->dmc_clk)) {
> +               if (PTR_ERR(data->dmc_clk) == -EPROBE_DEFER)
> +                       return -EPROBE_DEFER;
> +
>                 dev_err(dev, "Cannot get the clk dmc_clk\n");
>                 return PTR_ERR(data->dmc_clk);
>         };
> --
> 2.17.0
>

Kind regards
Uffe
Ezequiel Garcia April 23, 2018, 1:37 p.m. UTC | #2
On Mon, 2018-04-23 at 12:44 +0200, Ulf Hansson wrote:
> On 19 April 2018 at 12:40, Enric Balletbo i Serra
> <enric.balletbo@collabora.com> wrote:
> > From: Lin Huang <hl@rock-chips.com>
> > 
> > We just return -EPROBE_DEFER error code to caller and do not
> > print error message when try to get center logic regulator
> > and DMC clock defer.
> > 
> > Signed-off-by: Lin Huang <hl@rock-chips.com>
> > Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> > ---
> > 
> >  drivers/devfreq/rk3399_dmc.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c
> > index 44a379657cd5..5bfca028eaaf 100644
> > --- a/drivers/devfreq/rk3399_dmc.c
> > +++ b/drivers/devfreq/rk3399_dmc.c
> > @@ -308,12 +308,18 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
> > 
> >         data->vdd_center = devm_regulator_get(dev, "center");
> >         if (IS_ERR(data->vdd_center)) {
> > +               if (PTR_ERR(data->vdd_center) == -EPROBE_DEFER)
> > +                       return -EPROBE_DEFER;
> > +
> >                 dev_err(dev, "Cannot get the regulator \"center\"\n");
> 
> Doesn't the clock core already print an error message for this?
> 

s/clock/regulator?

> Maybe a better way is simply to drop the printing instead of trying to
> have a special case for it?
> 

I don't think so.

If you remove this print you: i) might get a print from the core,
or ii) maybe not because of some path without a print.

And even if you do get an error, it might not relate exactly to the
driver that requested the resource, because you might be printing
via pr_xxx, from a context without a struct dev to use dev_xxx.

> >                 return PTR_ERR(data->vdd_center);
> >         }
> > 
> >         data->dmc_clk = devm_clk_get(dev, "dmc_clk");
> >         if (IS_ERR(data->dmc_clk)) {
> > +               if (PTR_ERR(data->dmc_clk) == -EPROBE_DEFER)
> > +                       return -EPROBE_DEFER;
> > +
> >                 dev_err(dev, "Cannot get the clk dmc_clk\n");
> >                 return PTR_ERR(data->dmc_clk);
> >         };
> > --
> > 2.17.0
> > 
> 
> Kind regards
> Uffe
>
MyungJoo Ham April 24, 2018, 2:33 a.m. UTC | #3
> From: Lin Huang <hl@rock-chips.com>
> 
> We just return -EPROBE_DEFER error code to caller and do not
> print error message when try to get center logic regulator
> and DMC clock defer.
> 
> Signed-off-by: Lin Huang <hl@rock-chips.com>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>

Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>

I'll wait for the rebase of 3/6.

> ---
> 
>  drivers/devfreq/rk3399_dmc.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
Chanwoo Choi April 24, 2018, 3:55 a.m. UTC | #4
On 2018년 04월 19일 19:40, Enric Balletbo i Serra wrote:
> From: Lin Huang <hl@rock-chips.com>
> 
> We just return -EPROBE_DEFER error code to caller and do not
> print error message when try to get center logic regulator
> and DMC clock defer.
> 
> Signed-off-by: Lin Huang <hl@rock-chips.com>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
> 
>  drivers/devfreq/rk3399_dmc.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c
> index 44a379657cd5..5bfca028eaaf 100644
> --- a/drivers/devfreq/rk3399_dmc.c
> +++ b/drivers/devfreq/rk3399_dmc.c
> @@ -308,12 +308,18 @@ static int rk3399_dmcfreq_probe(struct platform_device *pdev)
>  
>  	data->vdd_center = devm_regulator_get(dev, "center");
>  	if (IS_ERR(data->vdd_center)) {
> +		if (PTR_ERR(data->vdd_center) == -EPROBE_DEFER)
> +			return -EPROBE_DEFER;
> +
>  		dev_err(dev, "Cannot get the regulator \"center\"\n");
>  		return PTR_ERR(data->vdd_center);
>  	}
>  
>  	data->dmc_clk = devm_clk_get(dev, "dmc_clk");
>  	if (IS_ERR(data->dmc_clk)) {
> +		if (PTR_ERR(data->dmc_clk) == -EPROBE_DEFER)
> +			return -EPROBE_DEFER;
> +
>  		dev_err(dev, "Cannot get the clk dmc_clk\n");
>  		return PTR_ERR(data->dmc_clk);
>  	};
> 

Looks good to me.
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
diff mbox

Patch

diff --git a/drivers/devfreq/rk3399_dmc.c b/drivers/devfreq/rk3399_dmc.c
index 44a379657cd5..5bfca028eaaf 100644
--- a/drivers/devfreq/rk3399_dmc.c
+++ b/drivers/devfreq/rk3399_dmc.c
@@ -308,12 +308,18 @@  static int rk3399_dmcfreq_probe(struct platform_device *pdev)
 
 	data->vdd_center = devm_regulator_get(dev, "center");
 	if (IS_ERR(data->vdd_center)) {
+		if (PTR_ERR(data->vdd_center) == -EPROBE_DEFER)
+			return -EPROBE_DEFER;
+
 		dev_err(dev, "Cannot get the regulator \"center\"\n");
 		return PTR_ERR(data->vdd_center);
 	}
 
 	data->dmc_clk = devm_clk_get(dev, "dmc_clk");
 	if (IS_ERR(data->dmc_clk)) {
+		if (PTR_ERR(data->dmc_clk) == -EPROBE_DEFER)
+			return -EPROBE_DEFER;
+
 		dev_err(dev, "Cannot get the clk dmc_clk\n");
 		return PTR_ERR(data->dmc_clk);
 	};