lkml.org 
[lkml]   [2003]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: Retriving PCI driver data from file ops
Date
From
> 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/

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