Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75878
b: refs/heads/master
c: 71da890
h: refs/heads/master
v: v3
  • Loading branch information
Dave Young authored and Greg Kroah-Hartman committed Jan 25, 2008
1 parent a97e4bf commit 0c772d6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 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: 443cad920a1c6894da3de917ce02a194cc6d80ea
refs/heads/master: 71da890509fec13d54329485bf5e4ac16b992bb6
22 changes: 12 additions & 10 deletions trunk/drivers/rtc/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,28 +251,30 @@ void rtc_update_irq(struct rtc_device *rtc,
}
EXPORT_SYMBOL_GPL(rtc_update_irq);

static int __rtc_match(struct device *dev, void *data)
{
char *name = (char *)data;

if (strncmp(dev->bus_id, name, BUS_ID_SIZE) == 0)
return 1;
return 0;
}

struct rtc_device *rtc_class_open(char *name)
{
struct device *dev;
struct rtc_device *rtc = NULL;

down(&rtc_class->sem);
list_for_each_entry(dev, &rtc_class->devices, node) {
if (strncmp(dev->bus_id, name, BUS_ID_SIZE) == 0) {
dev = get_device(dev);
if (dev)
rtc = to_rtc_device(dev);
break;
}
}
dev = class_find_device(rtc_class, name, __rtc_match);
if (dev)
rtc = to_rtc_device(dev);

if (rtc) {
if (!try_module_get(rtc->owner)) {
put_device(dev);
rtc = NULL;
}
}
up(&rtc_class->sem);

return rtc;
}
Expand Down

0 comments on commit 0c772d6

Please sign in to comment.