All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: renesas: mstp: Remove error messages on out-of-memory conditions
@ 2019-05-27 12:35 Geert Uytterhoeven
  2019-05-29 10:29 ` Simon Horman
  2019-05-29 21:07 ` Niklas Söderlund
  0 siblings, 2 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2019-05-27 12:35 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: linux-renesas-soc, linux-clk, Geert Uytterhoeven

pm_clk_create() and pm_clk_add_clk() can fail only when running out of
memory.  Hence there is no need to print error messages on failure, as
the memory allocation core already takes care of that.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
To be queued in clk-renesas-for-v5.3.

 drivers/clk/renesas/clk-mstp.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c
index ebd5cd74ca0733d8..a5e9f9edf04079c7 100644
--- a/drivers/clk/renesas/clk-mstp.c
+++ b/drivers/clk/renesas/clk-mstp.c
@@ -298,16 +298,12 @@ int cpg_mstp_attach_dev(struct generic_pm_domain *unused, struct device *dev)
 		return PTR_ERR(clk);
 
 	error = pm_clk_create(dev);
-	if (error) {
-		dev_err(dev, "pm_clk_create failed %d\n", error);
+	if (error)
 		goto fail_put;
-	}
 
 	error = pm_clk_add_clk(dev, clk);
-	if (error) {
-		dev_err(dev, "pm_clk_add_clk %pC failed %d\n", clk, error);
+	if (error)
 		goto fail_destroy;
-	}
 
 	return 0;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: renesas: mstp: Remove error messages on out-of-memory conditions
  2019-05-27 12:35 [PATCH] clk: renesas: mstp: Remove error messages on out-of-memory conditions Geert Uytterhoeven
@ 2019-05-29 10:29 ` Simon Horman
  2019-05-29 10:35   ` Simon Horman
  2019-05-29 21:07 ` Niklas Söderlund
  1 sibling, 1 reply; 6+ messages in thread
From: Simon Horman @ 2019-05-29 10:29 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Michael Turquette, Stephen Boyd, linux-renesas-soc, linux-clk

On Mon, May 27, 2019 at 02:35:14PM +0200, Geert Uytterhoeven wrote:
> pm_clk_create() and pm_clk_add_clk() can fail only when running out of
> memory.  Hence there is no need to print error messages on failure, as
> the memory allocation core already takes care of that.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: renesas: mstp: Remove error messages on out-of-memory conditions
  2019-05-29 10:29 ` Simon Horman
@ 2019-05-29 10:35   ` Simon Horman
  2019-05-29 12:21     ` Geert Uytterhoeven
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Horman @ 2019-05-29 10:35 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Michael Turquette, Stephen Boyd, linux-renesas-soc, linux-clk

On Wed, May 29, 2019 at 12:29:39PM +0200, Simon Horman wrote:
> On Mon, May 27, 2019 at 02:35:14PM +0200, Geert Uytterhoeven wrote:
> > pm_clk_create() and pm_clk_add_clk() can fail only when running out of
> > memory.  Hence there is no need to print error messages on failure, as
> > the memory allocation core already takes care of that.
> > 
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

On a closer look, I see that pm_clk_add_clk() can return
errors for other reasons. Can they never occur in this use-case?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: renesas: mstp: Remove error messages on out-of-memory conditions
  2019-05-29 10:35   ` Simon Horman
@ 2019-05-29 12:21     ` Geert Uytterhoeven
  2019-05-29 13:42       ` Simon Horman
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2019-05-29 12:21 UTC (permalink / raw)
  To: Simon Horman
  Cc: Geert Uytterhoeven, Michael Turquette, Stephen Boyd,
	Linux-Renesas, linux-clk

Hi Simon,

On Wed, May 29, 2019 at 12:35 PM Simon Horman <horms@verge.net.au> wrote:
> On Wed, May 29, 2019 at 12:29:39PM +0200, Simon Horman wrote:
> > On Mon, May 27, 2019 at 02:35:14PM +0200, Geert Uytterhoeven wrote:
> > > pm_clk_create() and pm_clk_add_clk() can fail only when running out of
> > > memory.  Hence there is no need to print error messages on failure, as
> > > the memory allocation core already takes care of that.
> > >
> > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >
> > Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
>
> On a closer look, I see that pm_clk_add_clk() can return
> errors for other reasons. Can they never occur in this use-case?

These are the cases where con_id is non-NULL, right?
pm_clk_add_clk() calls __pm_clk_add() with con_id == NULL.

Or do you mean the case where clk is an error pointer? That cannot
happen neither.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: renesas: mstp: Remove error messages on out-of-memory conditions
  2019-05-29 12:21     ` Geert Uytterhoeven
@ 2019-05-29 13:42       ` Simon Horman
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Horman @ 2019-05-29 13:42 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Geert Uytterhoeven, Michael Turquette, Stephen Boyd,
	Linux-Renesas, linux-clk

On Wed, May 29, 2019 at 02:21:46PM +0200, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Wed, May 29, 2019 at 12:35 PM Simon Horman <horms@verge.net.au> wrote:
> > On Wed, May 29, 2019 at 12:29:39PM +0200, Simon Horman wrote:
> > > On Mon, May 27, 2019 at 02:35:14PM +0200, Geert Uytterhoeven wrote:
> > > > pm_clk_create() and pm_clk_add_clk() can fail only when running out of
> > > > memory.  Hence there is no need to print error messages on failure, as
> > > > the memory allocation core already takes care of that.
> > > >
> > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > >
> > > Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
> >
> > On a closer look, I see that pm_clk_add_clk() can return
> > errors for other reasons. Can they never occur in this use-case?
> 
> These are the cases where con_id is non-NULL, right?
> pm_clk_add_clk() calls __pm_clk_add() with con_id == NULL.
> 
> Or do you mean the case where clk is an error pointer? That cannot
> happen neither.

I was referring to the latter. But if it can't happen then I'm happy
with this patch.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] clk: renesas: mstp: Remove error messages on out-of-memory conditions
  2019-05-27 12:35 [PATCH] clk: renesas: mstp: Remove error messages on out-of-memory conditions Geert Uytterhoeven
  2019-05-29 10:29 ` Simon Horman
@ 2019-05-29 21:07 ` Niklas Söderlund
  1 sibling, 0 replies; 6+ messages in thread
From: Niklas Söderlund @ 2019-05-29 21:07 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Michael Turquette, Stephen Boyd, linux-renesas-soc, linux-clk

Hi Geert,

Thanks for your work.

On 2019-05-27 14:35:14 +0200, Geert Uytterhoeven wrote:
> pm_clk_create() and pm_clk_add_clk() can fail only when running out of
> memory.  Hence there is no need to print error messages on failure, as
> the memory allocation core already takes care of that.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
> To be queued in clk-renesas-for-v5.3.
> 
>  drivers/clk/renesas/clk-mstp.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/clk/renesas/clk-mstp.c b/drivers/clk/renesas/clk-mstp.c
> index ebd5cd74ca0733d8..a5e9f9edf04079c7 100644
> --- a/drivers/clk/renesas/clk-mstp.c
> +++ b/drivers/clk/renesas/clk-mstp.c
> @@ -298,16 +298,12 @@ int cpg_mstp_attach_dev(struct generic_pm_domain *unused, struct device *dev)
>  		return PTR_ERR(clk);
>  
>  	error = pm_clk_create(dev);
> -	if (error) {
> -		dev_err(dev, "pm_clk_create failed %d\n", error);
> +	if (error)
>  		goto fail_put;
> -	}
>  
>  	error = pm_clk_add_clk(dev, clk);
> -	if (error) {
> -		dev_err(dev, "pm_clk_add_clk %pC failed %d\n", clk, error);
> +	if (error)
>  		goto fail_destroy;
> -	}
>  
>  	return 0;
>  
> -- 
> 2.17.1
> 

-- 
Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-05-29 21:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-27 12:35 [PATCH] clk: renesas: mstp: Remove error messages on out-of-memory conditions Geert Uytterhoeven
2019-05-29 10:29 ` Simon Horman
2019-05-29 10:35   ` Simon Horman
2019-05-29 12:21     ` Geert Uytterhoeven
2019-05-29 13:42       ` Simon Horman
2019-05-29 21:07 ` Niklas Söderlund

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.