lkml.org 
[lkml]   [2015]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [rtc-linux] [PATCH v3 2/3] rtc: mediatek: Add MT6397 RTC driver
Hi,

This looks mostly good. Could you align the wrapped function parameters
to the open parenthesis (use checkpatch --strict)?

On 28/04/2015 at 15:35:55 +0800, Eddie Huang wrote :
> +static int mtk_rtc_write_trigger(struct mt6397_rtc *rtc)
> +{
> + unsigned long timeout = jiffies + HZ;
> + int ret;
> + u32 data;
> +
> + ret = regmap_write(rtc->regmap, rtc->addr_base + RTC_WRTGR, 1);
> + if (ret < 0)
> + return ret;
> +
> + do {
> + cpu_relax();
> + ret = regmap_read(rtc->regmap, rtc->addr_base + RTC_BBPU,
> + &data);
> + if (ret < 0)
> + goto exit;
> + } while ((data & RTC_BBPU_CBUSY) && time_after(timeout, jiffies));
> +

Shouldn't you return -ETIMEDOUT if the loop breaks because of time_after?

Thanks,

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


\
 
 \ /
  Last update: 2015-05-05 22:21    [W:0.106 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site