mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 16:54:21 +00:00 
			
		
		
		
	rtc: tegra: Switch to use %ptR
Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
		
							parent
							
								
									5527842eab
								
							
						
					
					
						commit
						d54fb48616
					
				
					 1 changed files with 3 additions and 27 deletions
				
			
		|  | @ -125,15 +125,7 @@ static int tegra_rtc_read_time(struct device *dev, struct rtc_time *tm) | ||||||
| 
 | 
 | ||||||
| 	rtc_time_to_tm(sec, tm); | 	rtc_time_to_tm(sec, tm); | ||||||
| 
 | 
 | ||||||
| 	dev_vdbg(dev, "time read as %lu. %d/%d/%d %d:%02u:%02u\n", | 	dev_vdbg(dev, "time read as %lu. %ptR\n", sec, tm); | ||||||
| 		sec, |  | ||||||
| 		tm->tm_mon + 1, |  | ||||||
| 		tm->tm_mday, |  | ||||||
| 		tm->tm_year + 1900, |  | ||||||
| 		tm->tm_hour, |  | ||||||
| 		tm->tm_min, |  | ||||||
| 		tm->tm_sec |  | ||||||
| 	); |  | ||||||
| 
 | 
 | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
|  | @ -147,15 +139,7 @@ static int tegra_rtc_set_time(struct device *dev, struct rtc_time *tm) | ||||||
| 	/* convert tm to seconds. */ | 	/* convert tm to seconds. */ | ||||||
| 	rtc_tm_to_time(tm, &sec); | 	rtc_tm_to_time(tm, &sec); | ||||||
| 
 | 
 | ||||||
| 	dev_vdbg(dev, "time set to %lu. %d/%d/%d %d:%02u:%02u\n", | 	dev_vdbg(dev, "time set to %lu. %ptR\n", sec, tm); | ||||||
| 		sec, |  | ||||||
| 		tm->tm_mon+1, |  | ||||||
| 		tm->tm_mday, |  | ||||||
| 		tm->tm_year+1900, |  | ||||||
| 		tm->tm_hour, |  | ||||||
| 		tm->tm_min, |  | ||||||
| 		tm->tm_sec |  | ||||||
| 	); |  | ||||||
| 
 | 
 | ||||||
| 	/* seconds only written if wait succeeded. */ | 	/* seconds only written if wait succeeded. */ | ||||||
| 	ret = tegra_rtc_wait_while_busy(dev); | 	ret = tegra_rtc_wait_while_busy(dev); | ||||||
|  | @ -232,15 +216,7 @@ static int tegra_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) | ||||||
| 	/* if successfully written and alarm is enabled ... */ | 	/* if successfully written and alarm is enabled ... */ | ||||||
| 	if (sec) { | 	if (sec) { | ||||||
| 		tegra_rtc_alarm_irq_enable(dev, 1); | 		tegra_rtc_alarm_irq_enable(dev, 1); | ||||||
| 
 | 		dev_vdbg(dev, "alarm set as %lu. %ptR\n", sec, &alarm->time); | ||||||
| 		dev_vdbg(dev, "alarm set as %lu. %d/%d/%d %d:%02u:%02u\n", |  | ||||||
| 			sec, |  | ||||||
| 			alarm->time.tm_mon+1, |  | ||||||
| 			alarm->time.tm_mday, |  | ||||||
| 			alarm->time.tm_year+1900, |  | ||||||
| 			alarm->time.tm_hour, |  | ||||||
| 			alarm->time.tm_min, |  | ||||||
| 			alarm->time.tm_sec); |  | ||||||
| 	} else { | 	} else { | ||||||
| 		/* disable alarm if 0 or write error. */ | 		/* disable alarm if 0 or write error. */ | ||||||
| 		dev_vdbg(dev, "alarm disabled\n"); | 		dev_vdbg(dev, "alarm disabled\n"); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Andy Shevchenko
						Andy Shevchenko