aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-rs5c313.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-rs5c313.c')
-rw-r--r--drivers/rtc/rtc-rs5c313.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/rtc/rtc-rs5c313.c b/drivers/rtc/rtc-rs5c313.c
index 8089fc63e403..68f7856422f1 100644
--- a/drivers/rtc/rtc-rs5c313.c
+++ b/drivers/rtc/rtc-rs5c313.c
@@ -47,10 +47,10 @@
47#include <linux/platform_device.h> 47#include <linux/platform_device.h>
48#include <linux/bcd.h> 48#include <linux/bcd.h>
49#include <linux/delay.h> 49#include <linux/delay.h>
50#include <asm/io.h> 50#include <linux/io.h>
51 51
52#define DRV_NAME "rs5c313" 52#define DRV_NAME "rs5c313"
53#define DRV_VERSION "1.13" 53#define DRV_VERSION "1.13"
54 54
55#ifdef CONFIG_SH_LANDISK 55#ifdef CONFIG_SH_LANDISK
56/*****************************************************/ 56/*****************************************************/
@@ -301,7 +301,7 @@ static int rs5c313_rtc_set_time(struct device *dev, struct rtc_time *tm)
301 rs5c313_write_reg(RS5C313_ADDR_SEC10, (data >> 4)); 301 rs5c313_write_reg(RS5C313_ADDR_SEC10, (data >> 4));
302 302
303 data = bin2bcd(tm->tm_min); 303 data = bin2bcd(tm->tm_min);
304 rs5c313_write_reg(RS5C313_ADDR_MIN, data ); 304 rs5c313_write_reg(RS5C313_ADDR_MIN, data);
305 rs5c313_write_reg(RS5C313_ADDR_MIN10, (data >> 4)); 305 rs5c313_write_reg(RS5C313_ADDR_MIN10, (data >> 4));
306 306
307 data = bin2bcd(tm->tm_hour); 307 data = bin2bcd(tm->tm_hour);
@@ -310,7 +310,7 @@ static int rs5c313_rtc_set_time(struct device *dev, struct rtc_time *tm)
310 310
311 data = bin2bcd(tm->tm_mday); 311 data = bin2bcd(tm->tm_mday);
312 rs5c313_write_reg(RS5C313_ADDR_DAY, data); 312 rs5c313_write_reg(RS5C313_ADDR_DAY, data);
313 rs5c313_write_reg(RS5C313_ADDR_DAY10, (data>> 4)); 313 rs5c313_write_reg(RS5C313_ADDR_DAY10, (data >> 4));
314 314
315 data = bin2bcd(tm->tm_mon + 1); 315 data = bin2bcd(tm->tm_mon + 1);
316 rs5c313_write_reg(RS5C313_ADDR_MON, data); 316 rs5c313_write_reg(RS5C313_ADDR_MON, data);
@@ -349,9 +349,9 @@ static void rs5c313_check_xstp_bit(void)
349 } 349 }
350 350
351 memset(&tm, 0, sizeof(struct rtc_time)); 351 memset(&tm, 0, sizeof(struct rtc_time));
352 tm.tm_mday = 1; 352 tm.tm_mday = 1;
353 tm.tm_mon = 1 - 1; 353 tm.tm_mon = 1 - 1;
354 tm.tm_year = 2000 - 1900; 354 tm.tm_year = 2000 - 1900;
355 355
356 rs5c313_rtc_set_time(NULL, &tm); 356 rs5c313_rtc_set_time(NULL, &tm);
357 pr_err("invalid value, resetting to 1 Jan 2000\n"); 357 pr_err("invalid value, resetting to 1 Jan 2000\n");
@@ -378,18 +378,12 @@ static int rs5c313_rtc_probe(struct platform_device *pdev)
378 return 0; 378 return 0;
379} 379}
380 380
381static int rs5c313_rtc_remove(struct platform_device *pdev)
382{
383 return 0;
384}
385
386static struct platform_driver rs5c313_rtc_platform_driver = { 381static struct platform_driver rs5c313_rtc_platform_driver = {
387 .driver = { 382 .driver = {
388 .name = DRV_NAME, 383 .name = DRV_NAME,
389 .owner = THIS_MODULE, 384 .owner = THIS_MODULE,
390 }, 385 },
391 .probe = rs5c313_rtc_probe, 386 .probe = rs5c313_rtc_probe,
392 .remove = rs5c313_rtc_remove,
393}; 387};
394 388
395static int __init rs5c313_rtc_init(void) 389static int __init rs5c313_rtc_init(void)
@@ -408,7 +402,7 @@ static int __init rs5c313_rtc_init(void)
408 402
409static void __exit rs5c313_rtc_exit(void) 403static void __exit rs5c313_rtc_exit(void)
410{ 404{
411 platform_driver_unregister( &rs5c313_rtc_platform_driver ); 405 platform_driver_unregister(&rs5c313_rtc_platform_driver);
412} 406}
413 407
414module_init(rs5c313_rtc_init); 408module_init(rs5c313_rtc_init);