From: Alexandre Belloni Date: Wed, 21 Feb 2018 10:33:37 +0000 (+0100) Subject: rtc: omap: stop validating rtc_time in .set_time and .set_alarm X-Git-Tag: v5.15~9060^2~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ddc153d5f9442124cc083b15489932e45202661;p=platform%2Fkernel%2Flinux-starfive.git rtc: omap: stop validating rtc_time in .set_time and .set_alarm The RTC core is always validating the rtc_time struct before calling .set_time or .set_alarm. It is not necessary to do it again. Also, rtc_time_to_tm never generates an invalid rtc_tm (it can be out of range though). Signed-off-by: Alexandre Belloni --- diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index e53cb27..3908639 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c @@ -273,9 +273,6 @@ static int omap_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) /* this hardware doesn't support "don't care" alarm fields */ static int tm2bcd(struct rtc_time *tm) { - if (rtc_valid_tm(tm) != 0) - return -EINVAL; - tm->tm_sec = bin2bcd(tm->tm_sec); tm->tm_min = bin2bcd(tm->tm_min); tm->tm_hour = bin2bcd(tm->tm_hour);