linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Retriving PCI driver data from file ops
@ 2003-12-09  2:26 James Lamanna
  0 siblings, 0 replies; 2+ messages in thread
From: James Lamanna @ 2003-12-09  2:26 UTC (permalink / raw)
  To: linux-kernel

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?

Please CC me for I am not subscribed.

-- 
James Lamanna

^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: Retriving PCI driver data from file ops
@ 2003-12-09  3:17 Perez-Gonzalez, Inaky
  0 siblings, 0 replies; 2+ messages in thread
From: Perez-Gonzalez, Inaky @ 2003-12-09  3:17 UTC (permalink / raw)
  To: James Lamanna, linux-kernel

> 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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-12-09  3:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-09  2:26 Retriving PCI driver data from file ops James Lamanna
2003-12-09  3:17 Perez-Gonzalez, Inaky

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).