mirror of
https://github.com/ukui/kernel.git
synced 2026-03-09 10:07:04 -07:00
rtc: stop validating rtc_time in .read_time
The RTC core is always calling rtc_valid_tm after the read_time callback. It is not necessary to call it just before returning from the callback. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
@@ -387,7 +387,7 @@ static int ac100_rtc_get_time(struct device *dev, struct rtc_time *rtc_tm)
|
||||
rtc_tm->tm_year = bcd2bin(reg[6] & AC100_RTC_YEA_MASK) +
|
||||
AC100_YEAR_OFF;
|
||||
|
||||
return rtc_valid_tm(rtc_tm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ac100_rtc_set_time(struct device *dev, struct rtc_time *rtc_tm)
|
||||
|
||||
@@ -36,7 +36,7 @@ static int au1xtoy_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||
|
||||
rtc_time_to_tm(t, tm);
|
||||
|
||||
return rtc_valid_tm(tm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int au1xtoy_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
||||
|
||||
@@ -110,7 +110,7 @@ static int bq32k_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||
tm->tm_year = bcd2bin(regs.years) +
|
||||
((regs.cent_hours & BQ32K_CENT) ? 100 : 0);
|
||||
|
||||
return rtc_valid_tm(tm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bq32k_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
||||
|
||||
@@ -99,7 +99,7 @@ static int ds1216_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||
if (tm->tm_year < 70)
|
||||
tm->tm_year += 100;
|
||||
|
||||
return rtc_valid_tm(tm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ds1216_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
||||
|
||||
@@ -211,7 +211,7 @@ static int ds1286_read_time(struct device *dev, struct rtc_time *tm)
|
||||
|
||||
tm->tm_mon--;
|
||||
|
||||
return rtc_valid_tm(tm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ds1286_set_time(struct device *dev, struct rtc_time *tm)
|
||||
|
||||
@@ -98,8 +98,7 @@ static int ds1302_rtc_get_time(struct device *dev, struct rtc_time *time)
|
||||
time->tm_mon = bcd2bin(buf[RTC_ADDR_MON]) - 1;
|
||||
time->tm_year = bcd2bin(buf[RTC_ADDR_YEAR]) + 100;
|
||||
|
||||
/* Time may not be set */
|
||||
return rtc_valid_tm(time);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct rtc_class_ops ds1302_rtc_ops = {
|
||||
|
||||
@@ -203,8 +203,7 @@ static int ds1305_get_time(struct device *dev, struct rtc_time *time)
|
||||
time->tm_hour, time->tm_mday,
|
||||
time->tm_mon, time->tm_year, time->tm_wday);
|
||||
|
||||
/* Time may not be set */
|
||||
return rtc_valid_tm(time);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ds1305_set_time(struct device *dev, struct rtc_time *time)
|
||||
|
||||
@@ -437,8 +437,7 @@ static int ds1307_get_time(struct device *dev, struct rtc_time *t)
|
||||
t->tm_hour, t->tm_mday,
|
||||
t->tm_mon, t->tm_year, t->tm_wday);
|
||||
|
||||
/* initial clock setting can be undefined */
|
||||
return rtc_valid_tm(t);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ds1307_set_time(struct device *dev, struct rtc_time *t)
|
||||
|
||||
@@ -254,7 +254,7 @@ static int ds1343_read_time(struct device *dev, struct rtc_time *dt)
|
||||
dt->tm_mon = bcd2bin(buf[5] & 0x1F) - 1;
|
||||
dt->tm_year = bcd2bin(buf[6]) + 100; /* year offset from 1900 */
|
||||
|
||||
return rtc_valid_tm(dt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ds1343_set_time(struct device *dev, struct rtc_time *dt)
|
||||
|
||||
@@ -66,7 +66,7 @@ static int ds1347_read_time(struct device *dev, struct rtc_time *dt)
|
||||
dt->tm_wday = bcd2bin(buf[5]) - 1;
|
||||
dt->tm_year = bcd2bin(buf[6]) + 100;
|
||||
|
||||
return rtc_valid_tm(dt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ds1347_set_time(struct device *dev, struct rtc_time *dt)
|
||||
|
||||
@@ -153,7 +153,7 @@ static int ds1390_read_time(struct device *dev, struct rtc_time *dt)
|
||||
/* adjust for century bit */
|
||||
dt->tm_year = bcd2bin(chip->txrx_buf[6]) + ((chip->txrx_buf[5] & 0x80) ? 100 : 0);
|
||||
|
||||
return rtc_valid_tm(dt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ds1390_set_time(struct device *dev, struct rtc_time *dt)
|
||||
|
||||
@@ -306,7 +306,7 @@ ds1685_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||
tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year);
|
||||
tm->tm_isdst = 0; /* RTC has hardcoded timezone, so don't use. */
|
||||
|
||||
return rtc_valid_tm(tm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -112,7 +112,7 @@ static int ds1742_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||
/* year is 1900 + tm->tm_year */
|
||||
tm->tm_year = bcd2bin(year) + bcd2bin(century) * 100 - 1900;
|
||||
|
||||
return rtc_valid_tm(tm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct rtc_class_ops ds1742_rtc_ops = {
|
||||
|
||||
@@ -207,7 +207,7 @@ static int ds2404_read_time(struct device *dev, struct rtc_time *dt)
|
||||
time = le32_to_cpu(time);
|
||||
|
||||
rtc_time_to_tm(time, dt);
|
||||
return rtc_valid_tm(dt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ds2404_set_mmss(struct device *dev, unsigned long secs)
|
||||
|
||||
@@ -145,7 +145,7 @@ static int ds3232_read_time(struct device *dev, struct rtc_time *time)
|
||||
|
||||
time->tm_year = bcd2bin(year) + add_century;
|
||||
|
||||
return rtc_valid_tm(time);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ds3232_set_time(struct device *dev, struct rtc_time *time)
|
||||
|
||||
@@ -176,7 +176,7 @@ static int efi_read_time(struct device *dev, struct rtc_time *tm)
|
||||
if (!convert_from_efi_time(&eft, tm))
|
||||
return -EIO;
|
||||
|
||||
return rtc_valid_tm(tm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int efi_set_time(struct device *dev, struct rtc_time *tm)
|
||||
|
||||
@@ -136,8 +136,7 @@ static int fm3130_get_time(struct device *dev, struct rtc_time *t)
|
||||
t->tm_hour, t->tm_mday,
|
||||
t->tm_mon, t->tm_year, t->tm_wday);
|
||||
|
||||
/* initial clock setting can be undefined */
|
||||
return rtc_valid_tm(t);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ static int isl12022_get_datetime(struct i2c_client *client, struct rtc_time *tm)
|
||||
tm->tm_sec, tm->tm_min, tm->tm_hour,
|
||||
tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday);
|
||||
|
||||
return rtc_valid_tm(tm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int isl12022_set_datetime(struct i2c_client *client, struct rtc_time *tm)
|
||||
|
||||
@@ -110,7 +110,7 @@ static int lpc24xx_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||
tm->tm_year = CT1_YEAR(ct1);
|
||||
tm->tm_yday = CT2_DOY(ct2);
|
||||
|
||||
return rtc_valid_tm(tm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lpc24xx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *wkalrm)
|
||||
|
||||
@@ -230,7 +230,7 @@ static int m41t80_get_datetime(struct i2c_client *client,
|
||||
|
||||
/* assume 20YY not 19YY, and ignore the Century Bit */
|
||||
tm->tm_year = bcd2bin(buf[M41T80_REG_YEAR]) + 100;
|
||||
return rtc_valid_tm(tm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Sets the given date and time to the real time clock. */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user