Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2692
b: refs/heads/master
c: 0058824
h: refs/heads/master
v: v3
  • Loading branch information
Ladislav Michl authored and Greg Kroah-Hartman committed Jun 22, 2005
1 parent c472beb commit 5cf3e5e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b46e334d77b2d3b8b3aa665c81c4afbe9f1f458
refs/heads/master: 00588243053bb40d0406c7843833f8fae81294ab
21 changes: 9 additions & 12 deletions trunk/drivers/i2c/chips/ds1337.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ static int ds1337_get_datetime(struct i2c_client *client, struct rtc_time *dt)
__FUNCTION__, result, buf[0], buf[1], buf[2], buf[3],
buf[4], buf[5], buf[6]);

if (result >= 0) {
if (result == 2) {
dt->tm_sec = BCD2BIN(buf[0]);
dt->tm_min = BCD2BIN(buf[1]);
val = buf[2] & 0x3f;
Expand All @@ -140,12 +140,12 @@ static int ds1337_get_datetime(struct i2c_client *client, struct rtc_time *dt)
__FUNCTION__, dt->tm_sec, dt->tm_min,
dt->tm_hour, dt->tm_mday,
dt->tm_mon, dt->tm_year, dt->tm_wday);
} else {
dev_err(&client->dev, "error reading data! %d\n", result);
result = -EIO;

return 0;
}

return result;
dev_err(&client->dev, "error reading data! %d\n", result);
return -EIO;
}

static int ds1337_set_datetime(struct i2c_client *client, struct rtc_time *dt)
Expand Down Expand Up @@ -185,14 +185,11 @@ static int ds1337_set_datetime(struct i2c_client *client, struct rtc_time *dt)
msg[0].buf = &buf[0];

result = i2c_transfer(client->adapter, msg, 1);
if (result < 0) {
dev_err(&client->dev, "error writing data! %d\n", result);
result = -EIO;
} else {
result = 0;
}
if (result == 1)
return 0;

return result;
dev_err(&client->dev, "error writing data! %d\n", result);
return -EIO;
}

static int ds1337_command(struct i2c_client *client, unsigned int cmd,
Expand Down

0 comments on commit 5cf3e5e

Please sign in to comment.