lkml.org 
[lkml]   [2004]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: proper place for devfs_register_chrdev with pci_module_init
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.039 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site