aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/hctosys.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/hctosys.c')
-rw-r--r--drivers/rtc/hctosys.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/rtc/hctosys.c b/drivers/rtc/hctosys.c
index d02fe9a0001f..f48a8aed5b0f 100644
--- a/drivers/rtc/hctosys.c
+++ b/drivers/rtc/hctosys.c
@@ -26,15 +26,15 @@ static int __init rtc_hctosys(void)
26{ 26{
27 int err; 27 int err;
28 struct rtc_time tm; 28 struct rtc_time tm;
29 struct class_device *class_dev = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE); 29 struct rtc_device *rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
30 30
31 if (class_dev == NULL) { 31 if (rtc == NULL) {
32 printk("%s: unable to open rtc device (%s)\n", 32 printk("%s: unable to open rtc device (%s)\n",
33 __FILE__, CONFIG_RTC_HCTOSYS_DEVICE); 33 __FILE__, CONFIG_RTC_HCTOSYS_DEVICE);
34 return -ENODEV; 34 return -ENODEV;
35 } 35 }
36 36
37 err = rtc_read_time(class_dev, &tm); 37 err = rtc_read_time(rtc, &tm);
38 if (err == 0) { 38 if (err == 0) {
39 err = rtc_valid_tm(&tm); 39 err = rtc_valid_tm(&tm);
40 if (err == 0) { 40 if (err == 0) {
@@ -46,7 +46,7 @@ static int __init rtc_hctosys(void)
46 46
47 do_settimeofday(&tv); 47 do_settimeofday(&tv);
48 48
49 dev_info(class_dev->dev, 49 dev_info(rtc->class_dev.dev,
50 "setting the system clock to " 50 "setting the system clock to "
51 "%d-%02d-%02d %02d:%02d:%02d (%u)\n", 51 "%d-%02d-%02d %02d:%02d:%02d (%u)\n",
52 tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, 52 tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
@@ -54,14 +54,14 @@ static int __init rtc_hctosys(void)
54 (unsigned int) tv.tv_sec); 54 (unsigned int) tv.tv_sec);
55 } 55 }
56 else 56 else
57 dev_err(class_dev->dev, 57 dev_err(rtc->class_dev.dev,
58 "hctosys: invalid date/time\n"); 58 "hctosys: invalid date/time\n");
59 } 59 }
60 else 60 else
61 dev_err(class_dev->dev, 61 dev_err(rtc->class_dev.dev,
62 "hctosys: unable to read the hardware clock\n"); 62 "hctosys: unable to read the hardware clock\n");
63 63
64 rtc_class_close(class_dev); 64 rtc_class_close(rtc);
65 65
66 return 0; 66 return 0;
67} 67}