lkml.org 
[lkml]   [2005]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2.6.14] i2c chips: ds1337 2/2
Patch for ds1337 i2c driver:

Fix BCD value errors when month=9, moving the increment inside the
BIN2BCD macro.
Fix similar code for the weekday value, just for consistency.

This bug was reported by Michael Burian <dynmail1@gassner-waagen.at>.

Signed-off-by: James Chapman <jchapman@katalix.com>

--
James Chapman
Katalix Systems Ltd
http://www.katalix.com
Catalysts for your Embedded Linux software development


Fix BCD value errors when month=9, moving the increment inside the
BIN2BCD macro.
Fix similar code for the weekday value, just for consistency.

This bug was reported by Michael Burian <dynmail1@gassner-waagen.at>.

Signed-off-by: James Chapman <jchapman@katalix.com>

Index: linux-2.6.14/drivers/i2c/chips/ds1337.c
===================================================================
--- linux-2.6.14.orig/drivers/i2c/chips/ds1337.c 2005-11-02 19:38:49.000000000 +0000
+++ linux-2.6.14/drivers/i2c/chips/ds1337.c 2005-11-02 19:38:58.000000000 +0000
@@ -177,9 +177,9 @@
buf[1] = BIN2BCD(dt->tm_sec);
buf[2] = BIN2BCD(dt->tm_min);
buf[3] = BIN2BCD(dt->tm_hour);
- buf[4] = BIN2BCD(dt->tm_wday) + 1;
+ buf[4] = BIN2BCD(dt->tm_wday + 1);
buf[5] = BIN2BCD(dt->tm_mday);
- buf[6] = BIN2BCD(dt->tm_mon) + 1;
+ buf[6] = BIN2BCD(dt->tm_mon + 1);
val = dt->tm_year;
if (val >= 100) {
val -= 100;
\
 
 \ /
  Last update: 2005-11-03 21:26    [W:0.033 / U:1.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site