From 222b9f933a76b127a073f45278d2b0199587e8ce Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 26 Mar 2006 01:37:31 -0800 Subject: [PATCH] [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 Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/tlclk.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/tlclk.c b/drivers/char/tlclk.c index 4c272189cd..2546637a55 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; -- 2.39.5