2004-11-17 12:35:29

by Rolf Eike Beer

[permalink] [raw]
Subject: Documentation/pci.txt inconsistency

The examples in section 2 of Documentation/pci.txt use pci_get_*. Some lines
later there is this funny little paragraph:

> Note that these functions are not hotplug-safe. Their hotplug-safe
> replacements are pci_get_device(), pci_get_class() and pci_get_subsys().
> They increment the reference count on the pci_dev that they return.
> You must eventually (possibly at module unload) decrement the reference
> count on these devices by calling pci_dev_put().

How about this:

These functions are hotplug-safe. They increment the reference count on the
pci_dev that they return. You must eventually (possibly at module unload)
decrement the reference count on these devices by calling pci_dev_put().

Eike


2004-11-17 23:57:40

by Greg KH

[permalink] [raw]
Subject: Re: Documentation/pci.txt inconsistency

On Wed, Nov 17, 2004 at 01:34:56PM +0100, Rolf Eike Beer wrote:
> The examples in section 2 of Documentation/pci.txt use pci_get_*. Some lines
> later there is this funny little paragraph:
>
> > Note that these functions are not hotplug-safe. Their hotplug-safe
> > replacements are pci_get_device(), pci_get_class() and pci_get_subsys().
> > They increment the reference count on the pci_dev that they return.
> > You must eventually (possibly at module unload) decrement the reference
> > count on these devices by calling pci_dev_put().
>
> How about this:
>
> These functions are hotplug-safe. They increment the reference count on the
> pci_dev that they return. You must eventually (possibly at module unload)
> decrement the reference count on these devices by calling pci_dev_put().

Great, care to send a patch instead?

thanks,

greg k-h

2004-11-18 09:44:59

by Rolf Eike Beer

[permalink] [raw]
Subject: Re: Documentation/pci.txt inconsistency

Greg KH wrote:
> On Wed, Nov 17, 2004 at 01:34:56PM +0100, Rolf Eike Beer wrote:
> > The examples in section 2 of Documentation/pci.txt use pci_get_*. Some
> > lines
> >
> > later there is this funny little paragraph:
> > > Note that these functions are not hotplug-safe. Their hotplug-safe
> > > replacements are pci_get_device(), pci_get_class() and
> > > pci_get_subsys(). They increment the reference count on the pci_dev
> > > that they return. You must eventually (possibly at module unload)
> > > decrement the reference count on these devices by calling
> > > pci_dev_put().
> >
> > How about this:
> >
> > These functions are hotplug-safe. They increment the reference count on
> > the pci_dev that they return. You must eventually (possibly at module
> > unload) decrement the reference count on these devices by calling
> > pci_dev_put().
>
> Great, care to send a patch instead?

Signed-off-by: Rolf Eike Beer <[email protected]>

--- linux-2.6.9/Documentation/pci.txt 2004-11-18 09:43:56.927721824 +0100
+++ linux-2.6.10-rc2/Documentation/pci.txt 2004-11-18 10:09:06.070297280 +0100
@@ -156,11 +156,9 @@
VENDOR_ID or DEVICE_ID. This allows searching for any device from a
specific vendor, for example.

-Note that these functions are not hotplug-safe. Their hotplug-safe
-replacements are pci_get_device(), pci_get_class() and pci_get_subsys().
-They increment the reference count on the pci_dev that they return.
-You must eventually (possibly at module unload) decrement the reference
-count on these devices by calling pci_dev_put().
+ These functions are hotplug-safe. They increment the reference count on
+the pci_dev that they return. You must eventually (possibly at module unload)
+decrement the reference count on these devices by calling pci_dev_put().


3. Enabling and disabling devices

2004-11-19 18:33:03

by Greg KH

[permalink] [raw]
Subject: Re: Documentation/pci.txt inconsistency

On Thu, Nov 18, 2004 at 10:45:01AM +0100, Rolf Eike Beer wrote:
> Greg KH wrote:
> > On Wed, Nov 17, 2004 at 01:34:56PM +0100, Rolf Eike Beer wrote:
> > > The examples in section 2 of Documentation/pci.txt use pci_get_*. Some
> > > lines
> > >
> > > later there is this funny little paragraph:
> > > > Note that these functions are not hotplug-safe. Their hotplug-safe
> > > > replacements are pci_get_device(), pci_get_class() and
> > > > pci_get_subsys(). They increment the reference count on the pci_dev
> > > > that they return. You must eventually (possibly at module unload)
> > > > decrement the reference count on these devices by calling
> > > > pci_dev_put().
> > >
> > > How about this:
> > >
> > > These functions are hotplug-safe. They increment the reference count on
> > > the pci_dev that they return. You must eventually (possibly at module
> > > unload) decrement the reference count on these devices by calling
> > > pci_dev_put().
> >
> > Great, care to send a patch instead?
>
> Signed-off-by: Rolf Eike Beer <[email protected]>

Applied, thanks.

greg k-h