aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tlclk.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-03-26 01:37:31 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 08:56:57 -0800
commit222b9f933a76b127a073f45278d2b0199587e8ce (patch)
treef8bc703ebd08a961c95183aad52bc349b3a787d5 /drivers/char/tlclk.c
parent3e88c17d404c5787afd5bd1763380317f5ccbf84 (diff)
downloadmrst-s0i3-test-222b9f933a76b127a073f45278d2b0199587e8ce.tar.gz
mrst-s0i3-test-222b9f933a76b127a073f45278d2b0199587e8ce.tar.xz
mrst-s0i3-test-222b9f933a76b127a073f45278d2b0199587e8ce.zip
[PATCH] tlclk: fix handling of device major
tlclk calls register_chrdev() and permits register_chrdev() to allocate the major, but it promptly forgets what that major was. So if there's no hardware present you still get "telco_clock" appearing in /proc/devices and, I assume, an oops reading /proc/devices if tlclk was a module. Fix. Mark, I'd suggest that that we not call register_chrdev() until _after_ we've established that the hardware is present. Cc: Mark Gross <mgross@linux.intel.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/tlclk.c')
-rw-r--r--drivers/char/tlclk.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c
index 4c272189cd4..2546637a55c 100644
--- a/drivers/char/tlclk.c
+++ b/drivers/char/tlclk.c
@@ -767,6 +767,7 @@ static int __init tlclk_init(void)
printk(KERN_ERR "tlclk: can't get major %d.\n", tlclk_major);
return ret;
}
+ tlclk_major = ret;
alarm_events = kzalloc( sizeof(struct tlclk_alarms), GFP_KERNEL);
if (!alarm_events)
goto out1;