linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Niehusmann <jan@gondor.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: cm4000 device creation again
Date: Fri, 07 Apr 2006 14:25:18 +0000	[thread overview]
Message-ID: <e15soe$v7$1@sea.gmane.org> (raw)
In-Reply-To: <1142167169.5920.3.camel@otto.ehbuehl.net>

[-- Attachment #1: Type: text/plain, Size: 756 bytes --]

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


[-- Attachment #2: cm4000-udev.diff --]
[-- Type: text/plain, Size: 635 bytes --]

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;
 }
 

      parent reply	other threads:[~2006-04-07 14:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-12 12:39 cm4000 device creation again Joachim Breitner
2006-03-13  7:02 ` Kay Sievers
2006-03-13 21:33 ` Joachim Breitner
2006-04-02 20:58 ` Joachim Breitner
2006-04-04 17:01 ` Greg KH
2006-04-06 13:57 ` Harald Welte
2006-04-06 14:02 ` Harald Welte
2006-04-06 14:53 ` Greg KH
2006-04-06 16:21 ` Joachim Breitner
2006-04-07 13:58 ` Jan Niehusmann
2006-04-07 14:25 ` Jan Niehusmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='e15soe$v7$1@sea.gmane.org' \
    --to=jan@gondor.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).