]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] tlclk: fix handling of device major
authorAndrew Morton <akpm@osdl.org>
Sat, 25 Mar 2006 05:29:13 +0000 (21:29 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 7 Apr 2006 16:44:26 +0000 (09:44 -0700)
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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/char/tlclk.c

index 4c272189cd4209a120cebd02294e9b791f53f6e4..2546637a55c0365ee8f37073b08427a777723404 100644 (file)
@@ -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;