From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Niehusmann Date: Fri, 07 Apr 2006 14:25:18 +0000 Subject: Re: cm4000 device creation again Message-Id: MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------010707040202020204000300" List-Id: References: <1142167169.5920.3.camel@otto.ehbuehl.net> In-Reply-To: <1142167169.5920.3.camel@otto.ehbuehl.net> To: linux-hotplug@vger.kernel.org This is a multi-part message in MIME format. --------------010707040202020204000300 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sorry for replying to my own posting ;-) Jan Niehusmann wrote: > So it looks to me like either class_device_create doesn't get called if > the cm4000_cs gets loaded in response to the card being inserted, or it > does get called but doesn't work because something else is not yet > properly initialized at that time. Looks like it's the second: Calling major=register_chrdev(...) before calling pcmcia_register_driver(...) in cmm_init() does help. So the problem was that cm4000_probe got called in response to pcmcia_register_driver, even before register_chrdev got called. Therefore, class_device_create didn't get a proper major number and failed. Patch attached, but as I'm writing this through gmane, I'm not sure if the patch will survive. Jan --------------010707040202020204000300 Content-Type: text/plain; name="cm4000-udev.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cm4000-udev.diff" diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index 02114a0..0550038 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c @@ -1981,10 +1981,6 @@ static int __init cmm_init(void) if (!cmm_class) return -1; - rc = pcmcia_register_driver(&cm4000_driver); - if (rc < 0) - return rc; - major = register_chrdev(0, DEVICE_NAME, &cm4000_fops); if (major < 0) { printk(KERN_WARNING MODULE_NAME @@ -1992,6 +1988,11 @@ static int __init cmm_init(void) return -1; } + rc = pcmcia_register_driver(&cm4000_driver); + if (rc < 0) + return rc; + + return 0; } --------------010707040202020204000300-- ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel