aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-rs5c372.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-rs5c372.c')
-rw-r--r--drivers/rtc/rtc-rs5c372.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c
index 6b67b5097927..7e63074708eb 100644
--- a/drivers/rtc/rtc-rs5c372.c
+++ b/drivers/rtc/rtc-rs5c372.c
@@ -99,7 +99,7 @@ static int rs5c_get_regs(struct rs5c372 *rs5c)
99 * least 80219 chips; this works around that bug. 99 * least 80219 chips; this works around that bug.
100 */ 100 */
101 if ((i2c_transfer(client->adapter, msgs, 1)) != 1) { 101 if ((i2c_transfer(client->adapter, msgs, 1)) != 1) {
102 pr_debug("%s: can't read registers\n", rs5c->rtc->name); 102 dev_warn(&client->dev, "can't read registers\n");
103 return -EIO; 103 return -EIO;
104 } 104 }
105 105
@@ -166,7 +166,7 @@ static int rs5c372_get_datetime(struct i2c_client *client, struct rtc_time *tm)
166 166
167 dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d, " 167 dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d, "
168 "mday=%d, mon=%d, year=%d, wday=%d\n", 168 "mday=%d, mon=%d, year=%d, wday=%d\n",
169 __FUNCTION__, 169 __func__,
170 tm->tm_sec, tm->tm_min, tm->tm_hour, 170 tm->tm_sec, tm->tm_min, tm->tm_hour,
171 tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); 171 tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday);
172 172
@@ -181,7 +181,7 @@ static int rs5c372_set_datetime(struct i2c_client *client, struct rtc_time *tm)
181 181
182 dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d " 182 dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d "
183 "mday=%d, mon=%d, year=%d, wday=%d\n", 183 "mday=%d, mon=%d, year=%d, wday=%d\n",
184 __FUNCTION__, 184 __func__,
185 tm->tm_sec, tm->tm_min, tm->tm_hour, 185 tm->tm_sec, tm->tm_min, tm->tm_hour,
186 tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); 186 tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday);
187 187
@@ -195,7 +195,7 @@ static int rs5c372_set_datetime(struct i2c_client *client, struct rtc_time *tm)
195 buf[7] = BIN2BCD(tm->tm_year - 100); 195 buf[7] = BIN2BCD(tm->tm_year - 100);
196 196
197 if ((i2c_master_send(client, buf, 8)) != 8) { 197 if ((i2c_master_send(client, buf, 8)) != 8) {
198 dev_err(&client->dev, "%s: write error\n", __FUNCTION__); 198 dev_err(&client->dev, "%s: write error\n", __func__);
199 return -EIO; 199 return -EIO;
200 } 200 }
201 201
@@ -220,7 +220,7 @@ static int rs5c372_get_trim(struct i2c_client *client, int *osc, int *trim)
220 *osc = (tmp & RS5C372_TRIM_XSL) ? 32000 : 32768; 220 *osc = (tmp & RS5C372_TRIM_XSL) ? 32000 : 32768;
221 221
222 if (trim) { 222 if (trim) {
223 dev_dbg(&client->dev, "%s: raw trim=%x\n", __FUNCTION__, tmp); 223 dev_dbg(&client->dev, "%s: raw trim=%x\n", __func__, tmp);
224 tmp &= RS5C372_TRIM_MASK; 224 tmp &= RS5C372_TRIM_MASK;
225 if (tmp & 0x3e) { 225 if (tmp & 0x3e) {
226 int t = tmp & 0x3f; 226 int t = tmp & 0x3f;
@@ -500,7 +500,7 @@ static int rs5c372_probe(struct i2c_client *client)
500 struct rs5c372 *rs5c372; 500 struct rs5c372 *rs5c372;
501 struct rtc_time tm; 501 struct rtc_time tm;
502 502
503 dev_dbg(&client->dev, "%s\n", __FUNCTION__); 503 dev_dbg(&client->dev, "%s\n", __func__);
504 504
505 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { 505 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
506 err = -ENODEV; 506 err = -ENODEV;
@@ -512,12 +512,12 @@ static int rs5c372_probe(struct i2c_client *client)
512 goto exit; 512 goto exit;
513 } 513 }
514 514
515 /* we read registers 0x0f then 0x00-0x0f; skip the first one */
516 rs5c372->regs=&rs5c372->buf[1];
517
518 rs5c372->client = client; 515 rs5c372->client = client;
519 i2c_set_clientdata(client, rs5c372); 516 i2c_set_clientdata(client, rs5c372);
520 517
518 /* we read registers 0x0f then 0x00-0x0f; skip the first one */
519 rs5c372->regs = &rs5c372->buf[1];
520
521 err = rs5c_get_regs(rs5c372); 521 err = rs5c_get_regs(rs5c372);
522 if (err < 0) 522 if (err < 0)
523 goto exit_kfree; 523 goto exit_kfree;