/* This function reads the current RTC time into tm in Gregorian date.  */
static int mxc_rtc_read_time(struct device *dev, struct rtc_time *tm)
/* This function reads the current RTC time into tm in Gregorian date.  */
static int mxc_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
	u32 val;
	do {
		val = get_alarm_or_time(dev, MXC_RTC_TIME);
	} while (val != get_alarm_or_time(dev, MXC_RTC_TIME));
	rtc_time_to_tm(val, tm);
	return 0;
}