RE: Retriving PCI driver data from file ops

From: Perez-Gonzalez, Inaky
Date: Mon Dec 08 2003 - 22:18:03 EST


> 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/