mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-04 04:02:26 +00:00
rtc: zynqmp: re-use rtc_time64_to_tm operation
This allows a subsequent commit to spin_unlock sooner. Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com> Link: https://lore.kernel.org/r/20191128015613.10003-1-jeff.dagenais@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
94a2507130
commit
519d63702d
@ -94,7 +94,7 @@ static int xlnx_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
|||||||
* RTC has updated the CURRENT_TIME with the time written into
|
* RTC has updated the CURRENT_TIME with the time written into
|
||||||
* SET_TIME_WRITE register.
|
* SET_TIME_WRITE register.
|
||||||
*/
|
*/
|
||||||
rtc_time64_to_tm(readl(xrtcdev->reg_base + RTC_CUR_TM), tm);
|
read_time = readl(xrtcdev->reg_base + RTC_CUR_TM);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* Time written in SET_TIME_WRITE has not yet updated into
|
* Time written in SET_TIME_WRITE has not yet updated into
|
||||||
@ -104,8 +104,8 @@ static int xlnx_rtc_read_time(struct device *dev, struct rtc_time *tm)
|
|||||||
* reading.
|
* reading.
|
||||||
*/
|
*/
|
||||||
read_time = readl(xrtcdev->reg_base + RTC_SET_TM_RD) - 1;
|
read_time = readl(xrtcdev->reg_base + RTC_SET_TM_RD) - 1;
|
||||||
rtc_time64_to_tm(read_time, tm);
|
|
||||||
}
|
}
|
||||||
|
rtc_time64_to_tm(read_time, tm);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user