Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 126363
b: refs/heads/master
c: d4afc76
h: refs/heads/master
i:
  126361: 912f61e
  126359: 546ebe2
v: v3
  • Loading branch information
Kay Sievers authored and Linus Torvalds committed Jan 6, 2009
1 parent 7b07016 commit 307a4a6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 103d6d9170e3ecd9cefee9406bf928e1fcc45cc5
refs/heads/master: d4afc76c0b59a37113e184004f8a9989cfc1ddd3
16 changes: 6 additions & 10 deletions trunk/drivers/rtc/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg)
struct rtc_time tm;
struct timespec ts = current_kernel_time();

if (strncmp(rtc->dev.bus_id,
CONFIG_RTC_HCTOSYS_DEVICE,
BUS_ID_SIZE) != 0)
if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0)
return 0;

rtc_read_time(rtc, &tm);
Expand All @@ -71,20 +69,18 @@ static int rtc_resume(struct device *dev)
time_t newtime;
struct timespec time;

if (strncmp(rtc->dev.bus_id,
CONFIG_RTC_HCTOSYS_DEVICE,
BUS_ID_SIZE) != 0)
if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0)
return 0;

rtc_read_time(rtc, &tm);
if (rtc_valid_tm(&tm) != 0) {
pr_debug("%s: bogus resume time\n", rtc->dev.bus_id);
pr_debug("%s: bogus resume time\n", dev_name(&rtc->dev));
return 0;
}
rtc_tm_to_time(&tm, &newtime);
if (newtime <= oldtime) {
if (newtime < oldtime)
pr_debug("%s: time travel!\n", rtc->dev.bus_id);
pr_debug("%s: time travel!\n", dev_name(&rtc->dev));
return 0;
}

Expand Down Expand Up @@ -156,7 +152,7 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
init_waitqueue_head(&rtc->irq_queue);

strlcpy(rtc->name, name, RTC_DEVICE_NAME_SIZE);
snprintf(rtc->dev.bus_id, BUS_ID_SIZE, "rtc%d", id);
dev_set_name(&rtc->dev, "rtc%d", id);

rtc_dev_prepare(rtc);

Expand All @@ -169,7 +165,7 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
rtc_proc_add_device(rtc);

dev_info(dev, "rtc core: registered %s as %s\n",
rtc->name, rtc->dev.bus_id);
rtc->name, dev_name(&rtc->dev));

return rtc;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/rtc/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ static int __rtc_match(struct device *dev, void *data)
{
char *name = (char *)data;

if (strncmp(dev->bus_id, name, BUS_ID_SIZE) == 0)
if (strcmp(dev_name(dev), name) == 0)
return 1;
return 0;
}
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/rtc/rtc-cmos.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)

cmos_rtc.dev = dev;
dev_set_drvdata(dev, &cmos_rtc);
rename_region(ports, cmos_rtc.rtc->dev.bus_id);
rename_region(ports, dev_name(&cmos_rtc.rtc->dev));

spin_lock_irq(&rtc_lock);

Expand Down Expand Up @@ -777,7 +777,7 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
rtc_cmos_int_handler = cmos_interrupt;

retval = request_irq(rtc_irq, rtc_cmos_int_handler,
IRQF_DISABLED, cmos_rtc.rtc->dev.bus_id,
IRQF_DISABLED, dev_name(&cmos_rtc.rtc->dev),
cmos_rtc.rtc);
if (retval < 0) {
dev_dbg(dev, "IRQ %d is already in use\n", rtc_irq);
Expand All @@ -795,7 +795,7 @@ cmos_do_probe(struct device *dev, struct resource *ports, int rtc_irq)
}

pr_info("%s: alarms up to one %s%s, %zd bytes nvram%s\n",
cmos_rtc.rtc->dev.bus_id,
dev_name(&cmos_rtc.rtc->dev),
is_valid_irq(rtc_irq)
? (cmos_rtc.mon_alrm
? "year"
Expand Down Expand Up @@ -885,7 +885,7 @@ static int cmos_suspend(struct device *dev, pm_message_t mesg)
}

pr_debug("%s: suspend%s, ctrl %02x\n",
cmos_rtc.rtc->dev.bus_id,
dev_name(&cmos_rtc.rtc->dev),
(tmp & RTC_AIE) ? ", alarm may wake" : "",
tmp);

Expand Down Expand Up @@ -941,7 +941,7 @@ static int cmos_resume(struct device *dev)
}

pr_debug("%s: resume, ctrl %02x\n",
cmos_rtc.rtc->dev.bus_id,
dev_name(&cmos_rtc.rtc->dev),
tmp);

return 0;
Expand Down

0 comments on commit 307a4a6

Please sign in to comment.