From: "Perez-Gonzalez, Inaky" <inaky.perez-gonzalez@intel.com>
To: "James Lamanna" <jamesl@appliedminds.com>,
<linux-kernel@vger.kernel.org>
Subject: RE: Retriving PCI driver data from file ops
Date: Mon, 8 Dec 2003 19:17:09 -0800 [thread overview]
Message-ID: <A20D5638D741DD4DBAAB80A95012C0AE0125DFCB@orsmsx409.jf.intel.com> (raw)
> 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)
next reply other threads:[~2003-12-09 3:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-09 3:17 Perez-Gonzalez, Inaky [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-12-09 2:26 Retriving PCI driver data from file ops James Lamanna
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A20D5638D741DD4DBAAB80A95012C0AE0125DFCB@orsmsx409.jf.intel.com \
--to=inaky.perez-gonzalez@intel.com \
--cc=jamesl@appliedminds.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).