mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	rtc: stmp3xxx: switch to rtc_time64_to_tm/rtc_tm_to_time64
Call the 64bit versions of rtc_tm time conversion now that the range is enforced by the core. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
		
							parent
							
								
									0d823abd7c
								
							
						
					
					
						commit
						a659a08180
					
				
					 1 changed files with 3 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -160,7 +160,7 @@ static int stmp3xxx_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm)
 | 
			
		|||
	if (ret)
 | 
			
		||||
		return ret;
 | 
			
		||||
 | 
			
		||||
	rtc_time_to_tm(readl(rtc_data->io + STMP3XXX_RTC_SECONDS), rtc_tm);
 | 
			
		||||
	rtc_time64_to_tm(readl(rtc_data->io + STMP3XXX_RTC_SECONDS), rtc_tm);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -214,17 +214,15 @@ static int stmp3xxx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm)
 | 
			
		|||
{
 | 
			
		||||
	struct stmp3xxx_rtc_data *rtc_data = dev_get_drvdata(dev);
 | 
			
		||||
 | 
			
		||||
	rtc_time_to_tm(readl(rtc_data->io + STMP3XXX_RTC_ALARM), &alm->time);
 | 
			
		||||
	rtc_time64_to_tm(readl(rtc_data->io + STMP3XXX_RTC_ALARM), &alm->time);
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int stmp3xxx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
 | 
			
		||||
{
 | 
			
		||||
	unsigned long t;
 | 
			
		||||
	struct stmp3xxx_rtc_data *rtc_data = dev_get_drvdata(dev);
 | 
			
		||||
 | 
			
		||||
	rtc_tm_to_time(&alm->time, &t);
 | 
			
		||||
	writel(t, rtc_data->io + STMP3XXX_RTC_ALARM);
 | 
			
		||||
	writel(rtc_tm_to_time64(&alm->time), rtc_data->io + STMP3XXX_RTC_ALARM);
 | 
			
		||||
 | 
			
		||||
	stmp3xxx_alarm_irq_enable(dev, alm->enabled);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue