lkml.org 
[lkml]   [2017]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] rtc: omap: check for clk_prepare_enable() error
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

\
 
 \ /
  Last update: 2017-12-18 22:43    [W:0.036 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site