mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Tobias Oed" <tobiasoed@hotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: Badness in pci_find_subsys
Date: Mon, 23 Feb 2004 18:12:20 -0500	[thread overview]
Message-ID: <BAY12-F33OzP0x9R09y0000867e@hotmail.com> (raw)

Greg KH wrote:

>On Mon, Feb 23, 2004 at 08:51:45AM -0800, Tobias Oed wrote:
>>[*]
>>Do I need to hold the pci_bus_lock spinlock for the following (checks for
>>NULL omitted here)
>>dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
>>dev = pci_dev_get(dev);
>>I'd rater use pci_get_slot instead of pci_find_slot, but I don't know how
>>to
>>get a struct pci_bus *  from an int.
>
>You should never need to use those functions at all anyway.  Just use
>the proper pci_register_driver() call and be done with it.
>
>thanks,
>
>greg k-h

Thanks for pointing that out. I don't know what I'm doing and starting by 
trying to fix a closed source driver is not making it any easier.
As Robin Rosenberg said elsethread, you may want to consider the following 
patch to warn programmers more consistently
Cheers, Tobias.
--- search.c.orig       2004-02-23 18:05:41.627162872 -0500
+++ search.c    2004-02-23 18:06:24.292676728 -0500
@@ -90,6 +90,10 @@
  * is located in system global list of PCI devices.  If the device
  * is found, a pointer to its data structure is returned.  If no
  * device is found, %NULL is returned.
+ *
+ * NOTE: Do not use this function anymore, use pci_get_slot() instead, as
+ * the pci device returned by this function can disappear at any moment in
+ * time.
  */
struct pci_dev *
pci_find_slot(unsigned int bus, unsigned int devfn)

_________________________________________________________________
Dream of owning a home? Find out how in the First-time Home Buying Guide. 
http://special.msn.com/home/firsthome.armx


             reply	other threads:[~2004-02-23 23:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-23 23:12 Tobias Oed [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-02-23 16:51 Tobias Oed
2004-02-23 21:09 ` Greg KH
2004-02-23  4:44 vishwas manral
2004-02-23  5:39 ` Robin Rosenberg
2004-02-23  7:30   ` Martin
2004-02-23  8:30     ` Robin Rosenberg
2004-02-23 21:08     ` Greg KH
2004-02-23  4:43 vishwas manral
2004-02-22 17:46 Robin Rosenberg
2004-02-22 17:52 ` Prakash K. Cheemplavam

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=BAY12-F33OzP0x9R09y0000867e@hotmail.com \
    --to=tobiasoed@hotmail.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

all inboxes | Powered by JetHome®