Messages in this thread | | | Subject | RE: Retriving PCI driver data from file ops | Date | Mon, 8 Dec 2003 19:17:09 -0800 | From | "Perez-Gonzalez, Inaky" <> |
| |
> From: James Lamanna > > Is there an elegant way to retrieve a pointer registered with > pci_set_drvdata() within an open fops function? > Or am I forced to make it a static variable?
Normally how you do this is that during open(), you associate your 'struct file's priv pointer to the specific instance of the device you are opening; in that instance structure you keep pointers to the 'struct pci_device' for your access needs.
See for a more complete reference:
http://kernel-janitor.sourceforge.net/kernel-janitor/docs/driver-howto.html#3.2.2
Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own (and my fault) - 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/
| |