mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-18 10:34:24 +08:00
rtc: davinci: remove useless error handling
convertfromdays and convert2days never return errors, stop handling non existent errors. Link: https://lore.kernel.org/r/20200305215022.32533-4-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
b6d8f58920
commit
6a5bbad586
@ -227,7 +227,7 @@ davinci_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int convertfromdays(u16 days, struct rtc_time *tm)
|
static void convertfromdays(u16 days, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
int tmp_days, year, mon;
|
int tmp_days, year, mon;
|
||||||
|
|
||||||
@ -250,10 +250,9 @@ static int convertfromdays(u16 days, struct rtc_time *tm)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int convert2days(u16 *days, struct rtc_time *tm)
|
static void convert2days(u16 *days, struct rtc_time *tm)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
*days = 0;
|
*days = 0;
|
||||||
@ -262,8 +261,6 @@ static int convert2days(u16 *days, struct rtc_time *tm)
|
|||||||
*days += rtc_year_days(1, 12, i);
|
*days += rtc_year_days(1, 12, i);
|
||||||
|
|
||||||
*days += rtc_year_days(tm->tm_mday, tm->tm_mon, 1900 + tm->tm_year);
|
*days += rtc_year_days(tm->tm_mday, tm->tm_mon, 1900 + tm->tm_year);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int davinci_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
static int davinci_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
||||||
@ -296,8 +293,7 @@ static int davinci_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
|||||||
days <<= 8;
|
days <<= 8;
|
||||||
days |= day0;
|
days |= day0;
|
||||||
|
|
||||||
if (convertfromdays(days, tm) < 0)
|
convertfromdays(days, tm);
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -391,8 +387,7 @@ static int davinci_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
|
|||||||
days <<= 8;
|
days <<= 8;
|
||||||
days |= day0;
|
days |= day0;
|
||||||
|
|
||||||
if (convertfromdays(days, &alm->time) < 0)
|
convertfromdays(days, &alm->time);
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
alm->pending = !!(rtcss_read(davinci_rtc,
|
alm->pending = !!(rtcss_read(davinci_rtc,
|
||||||
PRTCSS_RTC_CCTRL) &
|
PRTCSS_RTC_CCTRL) &
|
||||||
|
Loading…
Reference in New Issue
Block a user