Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42824
b: refs/heads/master
c: 5d469ec
h: refs/heads/master
v: v3
  • Loading branch information
Neil Horman authored and Linus Torvalds committed Dec 7, 2006
1 parent 83bf530 commit 88d0a8d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 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: dc168427e6250a5a24c59f34afed6538092dab42
refs/heads/master: 5d469ec0f40d65b2a0a704402990a43b2dafe197
2 changes: 2 additions & 0 deletions trunk/drivers/char/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ int misc_register(struct miscdevice * misc)
dev_t dev;
int err = 0;

INIT_LIST_HEAD(&misc->list);

down(&misc_sem);
list_for_each_entry(c, &misc_list, list) {
if (c->minor == misc->minor) {
Expand Down
23 changes: 18 additions & 5 deletions trunk/drivers/char/mmtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ static int __init mmtimer_init(void)
if (sn_rtc_cycles_per_second < 100000) {
printk(KERN_ERR "%s: unable to determine clock frequency\n",
MMTIMER_NAME);
return -1;
goto out1;
}

mmtimer_femtoperiod = ((unsigned long)1E15 + sn_rtc_cycles_per_second /
Expand All @@ -689,13 +689,13 @@ static int __init mmtimer_init(void)
if (request_irq(SGI_MMTIMER_VECTOR, mmtimer_interrupt, IRQF_PERCPU, MMTIMER_NAME, NULL)) {
printk(KERN_WARNING "%s: unable to allocate interrupt.",
MMTIMER_NAME);
return -1;
goto out1;
}

if (misc_register(&mmtimer_miscdev)) {
printk(KERN_ERR "%s: failed to register device\n",
MMTIMER_NAME);
return -1;
goto out2;
}

/* Get max numbered node, calculate slots needed */
Expand All @@ -709,16 +709,18 @@ static int __init mmtimer_init(void)
if (timers == NULL) {
printk(KERN_ERR "%s: failed to allocate memory for device\n",
MMTIMER_NAME);
return -1;
goto out3;
}

memset(timers,0,(sizeof(mmtimer_t *)*maxn));

/* Allocate mmtimer_t's for each online node */
for_each_online_node(node) {
timers[node] = kmalloc_node(sizeof(mmtimer_t)*NUM_COMPARATORS, GFP_KERNEL, node);
if (timers[node] == NULL) {
printk(KERN_ERR "%s: failed to allocate memory for device\n",
MMTIMER_NAME);
return -1;
goto out4;
}
for (i=0; i< NUM_COMPARATORS; i++) {
mmtimer_t * base = timers[node] + i;
Expand All @@ -739,6 +741,17 @@ static int __init mmtimer_init(void)
sn_rtc_cycles_per_second/(unsigned long)1E6);

return 0;

out4:
for_each_online_node(node) {
kfree(timers[node]);
}
out3:
misc_deregister(&mmtimer_miscdev);
out2:
free_irq(SGI_MMTIMER_VECTOR, NULL);
out1:
return -1;
}

module_init(mmtimer_init);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,7 @@ struct tpm_chip *tpm_register_hardware(struct device *dev, const struct tpm_vend

if (sysfs_create_group(&dev->kobj, chip->vendor.attr_group)) {
list_del(&chip->list);
misc_deregister(&chip->vendor.miscdev);
put_device(dev);
clear_bit(chip->dev_num, dev_mask);
kfree(chip);
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/input/misc/hp_sdc_rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,9 @@ static int __init hp_sdc_rtc_init(void)

if ((ret = hp_sdc_request_timer_irq(&hp_sdc_rtc_isr)))
return ret;
misc_register(&hp_sdc_rtc_dev);
if (misc_register(&hp_sdc_rtc_dev) != 0)
printk(KERN_INFO "Could not register misc. dev for i8042 rtc\n");

create_proc_read_entry ("driver/rtc", 0, NULL,
hp_sdc_rtc_read_proc, NULL);

Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/macintosh/apm_emu.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ static int __init apm_emu_init(void)
if (apm_proc)
apm_proc->owner = THIS_MODULE;

misc_register(&apm_device);
if (misc_register(&apm_device) != 0)
printk(KERN_INFO "Could not create misc. device for apm\n");

pmu_register_sleep_notifier(&apm_sleep_notifier);

Expand Down

0 comments on commit 88d0a8d

Please sign in to comment.