aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/rtc/class.c16
-rw-r--r--drivers/rtc/interface.c2
-rw-r--r--drivers/rtc/rtc-cmos.c10
3 files changed, 12 insertions, 16 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 4dfdf019fccc..be5a6b73e601 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -48,9 +48,7 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg)
48 struct rtc_time tm; 48 struct rtc_time tm;
49 struct timespec ts = current_kernel_time(); 49 struct timespec ts = current_kernel_time();
50 50
51 if (strncmp(rtc->dev.bus_id, 51 if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0)
52 CONFIG_RTC_HCTOSYS_DEVICE,
53 BUS_ID_SIZE) != 0)
54 return 0; 52 return 0;
55 53
56 rtc_read_time(rtc, &tm); 54 rtc_read_time(rtc, &tm);
@@ -71,20 +69,18 @@ static int rtc_resume(struct device *dev)
71 time_t newtime; 69 time_t newtime;
72 struct timespec time; 70 struct timespec time;
73 71
74 if (strncmp(rtc->dev.bus_id, 72 if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0)
75 CONFIG_RTC_HCTOSYS_DEVICE,
76 BUS_ID_SIZE) != 0)
77 return 0; 73 return 0;
78 74
79 rtc_read_time(rtc, &tm); 75 rtc_read_time(rtc, &tm);
80 if (rtc_valid_tm(&tm) != 0) { 76 if (rtc_valid_tm(&tm) != 0) {
81 pr_debug("%s: bogus resume time\n", rtc->dev.bus_id); 77 pr_debug("%s: bogus resume time\n", dev_name(&rtc->dev));
82 return 0; 78 return 0;
83 } 79 }
84 rtc_tm_to_time(&tm, &newtime); 80 rtc_tm_to_time(&tm, &newtime);
85 if (newtime <= oldtime) { 81 if (newtime <= oldtime) {
86 if (newtime < oldtime) 82 if (newtime < oldtime)
87 pr_debug("%s: time travel!\n", rtc->dev.bus_id); 83 pr_debug("%s: time travel!\n", dev_name(&rtc->dev));
88 return 0; 84 return 0;
89 } 85 }
90 86
@@ -156,7 +152,7 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
156 init_waitqueue_head(&rtc->irq_queue); 152 init_waitqueue_head(&rtc->irq_queue);
157 153
158 strlcpy(rtc->name, name, RTC_DEVICE_NAME_SIZE); 154 strlcpy(rtc->name, name, RTC_DEVICE_NAME_SIZE);
159 snprintf(rtc->dev.bus_id, BUS_ID_SIZE, "rtc%d", id); 155 dev_set_name(&rtc->dev, "rtc%d", id);
160 156
161 rtc_dev_prepare(rtc); 157 rtc_dev_prepare(rtc);
162 158
@@ -169,7 +165,7 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
169 rtc_proc_add_device(rtc); 165 rtc_proc_add_device(rtc);
170 166
171 dev_info(dev, "rtc core: registered %s as %s\n", 167 dev_info(dev, "rtc core: registered %s as %s\n",
172 rtc->name, rtc->dev.bus_id); 168 rtc->name, dev_name(&rtc->dev));
173 169
174 return rtc; 170 return rtc;
175 171
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index fd2c652504ff..43276f29d636 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -389,7 +389,7 @@ static int __rtc_match(struct device *dev, void *data)
389{ 389{
390 char *name = (char *)data; 390 char *name = (char *)data;
391 391
392 if (strncmp(dev->bus_id, name, BUS_ID_SIZE) == 0) 392 if (strcmp(dev_name(dev), name) == 0)
393 return 1; 393 return 1;
394 return 0; 394 return 0;
395} 395}
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 6cf8e282338f..d37bb86db5d0 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -729,7 +729,7 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
729 729
730 cmos_rtc.dev = dev; 730 cmos_rtc.dev = dev;
731 dev_set_drvdata(dev, &cmos_rtc); 731 dev_set_drvdata(dev, &cmos_rtc);
732 rename_region(ports, cmos_rtc.rtc->dev.bus_id); 732 rename_region(ports, dev_name(&cmos_rtc.rtc->dev));
733 733
734 spin_lock_irq(&rtc_lock); 734 spin_lock_irq(&rtc_lock);
735 735
@@ -777,7 +777,7 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
777 rtc_cmos_int_handler = cmos_interrupt; 777 rtc_cmos_int_handler = cmos_interrupt;
778 778
779 retval = request_irq(rtc_irq, rtc_cmos_int_handler, 779 retval = request_irq(rtc_irq, rtc_cmos_int_handler,
780 IRQF_DISABLED, cmos_rtc.rtc->dev.bus_id, 780 IRQF_DISABLED, dev_name(&cmos_rtc.rtc->dev),
781 cmos_rtc.rtc); 781 cmos_rtc.rtc);
782 if (retval < 0) { 782 if (retval < 0) {
783 dev_dbg(dev, "IRQ %d is already in use\n", rtc_irq); 783 dev_dbg(dev, "IRQ %d is already in use\n", rtc_irq);
@@ -795,7 +795,7 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
795 } 795 }
796 796
797 pr_info("%s: alarms up to one %s%s, %zd bytes nvram%s\n", 797 pr_info("%s: alarms up to one %s%s, %zd bytes nvram%s\n",
798 cmos_rtc.rtc->dev.bus_id, 798 dev_name(&cmos_rtc.rtc->dev),
799 is_valid_irq(rtc_irq) 799 is_valid_irq(rtc_irq)
800 ? (cmos_rtc.mon_alrm 800 ? (cmos_rtc.mon_alrm
801 ? "year" 801 ? "year"
@@ -885,7 +885,7 @@ static int cmos_suspend(struct device *dev, pm_message_t mesg)
885 } 885 }
886 886
887 pr_debug("%s: suspend%s, ctrl %02x\n", 887 pr_debug("%s: suspend%s, ctrl %02x\n",
888 cmos_rtc.rtc->dev.bus_id, 888 dev_name(&cmos_rtc.rtc->dev),
889 (tmp & RTC_AIE) ? ", alarm may wake" : "", 889 (tmp & RTC_AIE) ? ", alarm may wake" : "",
890 tmp); 890 tmp);
891 891
@@ -941,7 +941,7 @@ static int cmos_resume(struct device *dev)
941 } 941 }
942 942
943 pr_debug("%s: resume, ctrl %02x\n", 943 pr_debug("%s: resume, ctrl %02x\n",
944 cmos_rtc.rtc->dev.bus_id, 944 dev_name(&cmos_rtc.rtc->dev),
945 tmp); 945 tmp);
946 946
947 return 0; 947 return 0;