mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Andreas Platschek <andreas.platschek@opentech.at>
Cc: linux-kernel@vger.kernel.org, a.zummo@towertech.it,
	linux-rtc@vger.kernel.org
Subject: Re: [PATCH 1/2] rtc: omap: check for clk_prepare_enable() error
Date: Mon, 18 Dec 2017 22:42:49 +0100	[thread overview]
Message-ID: <20171218214249.GA15162@piout.net> (raw)
In-Reply-To: <20171206194238.12824-2-andreas.platschek@opentech.at>

On 06/12/2017 at 20:42:37 +0100, Andreas Platschek wrote:
> clk_prepare_enable() returns an error -> check it.
> 
> Signed-off-by: Andreas Platschek <andreas.platschek@opentech.at>
> ---
>  drivers/rtc/rtc-omap.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
> index 1d666ac9ef70..ad309feb7d11 100644
> --- a/drivers/rtc/rtc-omap.c
> +++ b/drivers/rtc/rtc-omap.c
> @@ -748,8 +748,15 @@ static int omap_rtc_probe(struct platform_device *pdev)
>  	else
>  		rtc->clk = devm_clk_get(&pdev->dev, "int-clk");
>  
> -	if (!IS_ERR(rtc->clk))
> -		clk_prepare_enable(rtc->clk);
> +	if (!IS_ERR(rtc->clk)) {
> +		ret = clk_prepare_enable(rtc->clk);
> +		if (ret) {
> +			dev_err(&pdev->dev,
> +				"Failed to enable rtc clk (%u)\n", ret);

As this will never fail, can we avoid having a useless string?

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2017-12-18 21:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 19:42 [PATCH 0/2] rtc: omap: clk_prepare_enable error handling Andreas Platschek
2017-12-06 19:42 ` [PATCH 1/2] rtc: omap: check for clk_prepare_enable() error Andreas Platschek
2017-12-18 21:42   ` Alexandre Belloni [this message]
2017-12-06 19:42 ` [PATCH 2/2] rtc: omap: fix unbalanced clk_prepare_enable/clk_disable_unprepare Andreas Platschek
2017-12-18 21:49   ` Alexandre Belloni

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=20171218214249.GA15162@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=a.zummo@towertech.it \
    --cc=andreas.platschek@opentech.at \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.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

Powered by JetHome