lkml.org 
[lkml]   [2012]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] rtc: Add NXP PCF8523 support
On Wed, 28 Nov 2012 20:21:26 +0100
Thierry Reding <thierry.reding@avionic-design.de> wrote:

> + err = i2c_transfer(client->adapter, &msg, 1);
> + if (err < 0) {
> + /*
> + * If the time cannot be set, restart the RTC anyway. Note
> + * that errors are ignored if the RTC cannot be started so
> + * that we have a chance to propagate the original error.
> + */
> + pcf8523_start_rtc(client);
> + return err;
> + }
> +
> + return pcf8523_start_rtc(client);

hm, well, that is of course equivalent to

err = i2c_transfer(client->adapter, &msg, 1);
pcf8523_start_rtc(client);
return err;

but I suppose the code as proposed is clear, extensible, and not our
worst-ever sin ;)



\
 
 \ /
  Last update: 2012-11-29 01:01    [W:0.038 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site