OSDN Git Service

rtc: hym8563: Return -EINVAL if the time is known to be invalid
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / drivers / rtc / rtc-hym8563.c
index b1b4746..dbec596 100644 (file)
@@ -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);