diff options
author | Harald Welte <laforge@gnumonks.org> | 2006-05-10 13:28:52 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-10 22:46:02 +0200 |
commit | 7fc5b1e3a170d865f625e609c087cf8d84fd285d (patch) | |
tree | 265b9811591ab24a59784a21598b7d9070480b26 /drivers/char/pcmcia/cm4040_cs.c | |
parent | Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/shem... (diff) | |
download | linux-7fc5b1e3a170d865f625e609c087cf8d84fd285d.tar.xz linux-7fc5b1e3a170d865f625e609c087cf8d84fd285d.zip |
[Cardman 40x0] Fix udev device creation
This patch corrects the order of the calls to register_chrdev() and
pcmcia_register_driver(). Now udev correctly creates userspace device
files /dev/cmmN and /dev/cmxN respectively.
Based on an earlier patch by Jan Niehusmann <jan@gondor.com>.
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/pcmcia/cm4040_cs.c')
-rw-r--r-- | drivers/char/pcmcia/cm4040_cs.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c index 29efa64580a8..47a8465bf95b 100644 --- a/drivers/char/pcmcia/cm4040_cs.c +++ b/drivers/char/pcmcia/cm4040_cs.c @@ -724,16 +724,19 @@ static int __init cm4040_init(void) if (!cmx_class) return -1; - rc = pcmcia_register_driver(&reader_driver); - if (rc < 0) - return rc; - major = register_chrdev(0, DEVICE_NAME, &reader_fops); if (major < 0) { printk(KERN_WARNING MODULE_NAME ": could not get major number\n"); return -1; } + + rc = pcmcia_register_driver(&reader_driver); + if (rc < 0) { + unregister_chrdev(major, DEVICE_NAME); + return rc; + } + return 0; } |