diff options
author | Harald Welte <laforge@gnumonks.org> | 2006-05-10 07:28:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-10 16:46:02 -0400 |
commit | 7fc5b1e3a170d865f625e609c087cf8d84fd285d (patch) | |
tree | 265b9811591ab24a59784a21598b7d9070480b26 /drivers/char/pcmcia/cm4040_cs.c | |
parent | 3cd73eedde34c5fd88d62d8523c4260970fdc6fb (diff) |
[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) | |||
724 | if (!cmx_class) | 724 | if (!cmx_class) |
725 | return -1; | 725 | return -1; |
726 | 726 | ||
727 | rc = pcmcia_register_driver(&reader_driver); | ||
728 | if (rc < 0) | ||
729 | return rc; | ||
730 | |||
731 | major = register_chrdev(0, DEVICE_NAME, &reader_fops); | 727 | major = register_chrdev(0, DEVICE_NAME, &reader_fops); |
732 | if (major < 0) { | 728 | if (major < 0) { |
733 | printk(KERN_WARNING MODULE_NAME | 729 | printk(KERN_WARNING MODULE_NAME |
734 | ": could not get major number\n"); | 730 | ": could not get major number\n"); |
735 | return -1; | 731 | return -1; |
736 | } | 732 | } |
733 | |||
734 | rc = pcmcia_register_driver(&reader_driver); | ||
735 | if (rc < 0) { | ||
736 | unregister_chrdev(major, DEVICE_NAME); | ||
737 | return rc; | ||
738 | } | ||
739 | |||
737 | return 0; | 740 | return 0; |
738 | } | 741 | } |
739 | 742 | ||