lkml.org 
[lkml]   [2011]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [rtc-linux] [PATCH 2/2] MAX8997/8966 RTC Driver Initial Release
On Fri, Mar 04, 2011 at 04:48:44PM +0900, MyungJoo Ham wrote:

> +static void tm_to_data(struct rtc_time *tm, u8 *data)
> +{
> + data[RTC_SEC] = bin2bcd(tm->tm_sec) & 0x7f;
> + data[RTC_MIN] = bin2bcd(tm->tm_min) & 0x7f;
> + data[RTC_HOUR] = bin2bcd(tm->tm_hour) & 0x3f;
> + data[RTC_WEEKDAY] = wday_kernel_to_8997(tm->tm_wday) & 0x7f;
> + data[RTC_MONTH] = bin2bcd(tm->tm_mon) & 0x1f;
> + data[RTC_YEAR] = bin2bcd((tm->tm_year > 100) ? (tm->tm_year - 100) : 0)
> + & 0x7f;
> + data[RTC_MONTHDAY] = bin2bcd(tm->tm_mday) & 0x3f;
> +
> + if (tm->tm_year < 100) /* Prior 2000 */
> + pr_warn("MAX8997 RTC cannot handle the year %d. "
> + "Assume it's 2000.\n", 1900 + tm->tm_year);

It seems like an attempt to set an unsupported year should return an
error rather than just displaying a warning (though the warning is
useful so the user can figure out what went wrong).

> +MODULE_DESCRIPTION("MAXIM 8997/8966 RTC Driver");
> +MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>");
> +MODULE_LICENSE("GPL");

A MODULE_ALIAS() would allow the driver to be automatically loaded when
built as a module.


\
 
 \ /
  Last update: 2011-03-06 12:19    [W:0.172 / U:5.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site