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