From: "Richard B. Johnson" <root@chaos.analogic.com>
To: Greg KH <greg@kroah.com>
Cc: odain2@mindspring.com, Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: proper place for devfs_register_chrdev with pci_module_init
Date: Thu, 5 Feb 2004 07:42:06 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.53.0402050739450.5456@chaos> (raw)
In-Reply-To: <20040204233400.GA5274@kroah.com>
On Wed, 4 Feb 2004, Greg KH wrote:
> On Wed, Feb 04, 2004 at 05:29:31PM -0500, Richard B. Johnson wrote:
> >
> > I would call pci_find_class() and continue until a NULL is returned
> > or my vendor and device are returned in the structure.
>
> NOOOOO!!!!!
>
> Do NOT do this. Use pci_register_driver() instead. Using pci_find_*()
> is just broken and wrong for 99% of all pci drivers.
>
> If you do this you do not hook up into sysfs properly. You do not get
> modules automatically loaded for your driver. You do not get notified
> if the device is removed from the system. And, most importantly, you do
> not get exclusive access to the pci device.
>
> As for the original poster, look at one of the many existing char
> drivers for examples of what you need to do to register a char driver
> properly. It really has nothing to do with the pci interface at all
> (with the exception of when to register it...)
>
> thanks,
>
> greg k-h
WTF? How do you find out if your board in actually in the system?
You CANNOT load all possible modules, hoping that somebody will
hot-plug in one of the devices a year from now.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.
next prev parent reply other threads:[~2004-02-05 12:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-04 20:23 Oliver Dain
2004-02-04 21:30 ` Richard B. Johnson
2004-02-04 21:48 ` odain2
2004-02-04 22:29 ` Richard B. Johnson
2004-02-04 23:34 ` Greg KH
2004-02-05 12:42 ` Richard B. Johnson [this message]
2004-02-05 15:27 ` Greg KH
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=Pine.LNX.4.53.0402050739450.5456@chaos \
--to=root@chaos.analogic.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=odain2@mindspring.com \
/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
all inboxes | Powered by JetHome®