linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: pdeschrijver@nvidia.com (Peter De Schrijver)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm/tegra: clk_get should not be fatal
Date: Tue, 25 Oct 2011 20:00:38 +0300	[thread overview]
Message-ID: <20111025170038.GT1001@tbergstrom-lnx.Nvidia.com> (raw)
In-Reply-To: <1319559968.14932.5.camel@Joe-Laptop>

On Tue, Oct 25, 2011 at 06:26:08PM +0200, Joe Perches wrote:
> On Tue, 2011-10-25 at 19:15 +0300, pdeschrijver at nvidia.com wrote:
> > The timer and rtc-timer clocks aren't gated by default, so there is no reason
> > to crash the system if the dummy enable call failed.
> []
> > diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
> []
> > @@ -186,16 +186,20 @@ static void __init tegra_init_timer(void)
> >  	int ret;
> >  
> >  	clk = clk_get_sys("timer", NULL);
> > -	BUG_ON(IS_ERR(clk));
> > -	clk_enable(clk);
> > +	if (IS_ERR(clk))
> > +		pr_warning("Unable to get timer clock");
> > +	else
> > +		clk_enable(clk);
> >  
> >  	/*
> >  	 * rtc registers are used by read_persistent_clock, keep the rtc clock
> >  	 * enabled
> >  	 */
> >  	clk = clk_get_sys("rtc-tegra", NULL);
> > -	BUG_ON(IS_ERR(clk));
> > -	clk_enable(clk);
> > +	if (IS_ERR(clk))
> > +		pr_warning("Unable to get rtc-tegra clock");
> > +	else
> > +		clk_enable(clk);
> 
> Are these messages are really necessary?

I think it's still useful to have them as not having a clock fw is a strange
situation. It's not fatal though, but worth a warning I would say.

> Maybe just:
> 	if (!IS_ERR(clk))
> 		clk_enable(clk)
> 
> If these are really necessary, please use
> 	pr_warn("Unable to get <foo>\n");
> pr_warn and with a terminating newline.
> 

Is pr_warn any different then pr_warning? Point taken about the newline.

Cheers,

Peter.

  reply	other threads:[~2011-10-25 17:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-25 16:15 [PATCH] arm/tegra: clk_get should not be fatal pdeschrijver at nvidia.com
2011-10-25 16:26 ` Joe Perches
2011-10-25 17:00   ` Peter De Schrijver [this message]
2011-10-26  1:15     ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111025170038.GT1001@tbergstrom-lnx.Nvidia.com \
    --to=pdeschrijver@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).