X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=drivers%2Frtc%2Frtc-hym8563.c;h=dbec596494ebe82581d2cfe1ef2446da15ff746f;hb=998863d414f50f482669de436cfdd96cfd913f0e;hp=097325d96db566e08ec8b70aaa9d595f6a044235;hpb=75021d28594d9b6fb4d05bbc41f77948a0db0e02;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c index 097325d96db5..dbec596494eb 100644 --- a/drivers/rtc/rtc-hym8563.c +++ b/drivers/rtc/rtc-hym8563.c @@ -105,7 +105,7 @@ static int hym8563_rtc_read_time(struct device *dev, struct rtc_time *tm) if (!hym8563->valid) { dev_warn(&client->dev, "no valid clock/calendar values available\n"); - return -EPERM; + return -EINVAL; } ret = i2c_smbus_read_i2c_block_data(client, HYM8563_SEC, 7, buf); @@ -144,7 +144,7 @@ static int hym8563_rtc_set_time(struct device *dev, struct rtc_time *tm) * it does not seem to carry it over a subsequent write/read. * So we'll limit ourself to 100 years, starting at 2000 for now. */ - buf[6] = tm->tm_year - 100; + buf[6] = bin2bcd(tm->tm_year - 100); /* * CTL1 only contains TEST-mode bits apart from stop,