Re: [PATCH 5/8] staging: vme: add functions for bridge modulerefcounting

From: Emilio G. Cota
Date: Wed Aug 10 2011 - 14:35:29 EST

On Wed, Aug 10, 2011 at 10:50:59 +0100, Martyn Welch wrote:
> Again, in pci-driver.c:
> static int pci_device_probe(struct device * dev)
> {
> int error = 0;
> struct pci_driver *drv;
> struct pci_dev *pci_dev;
> drv = to_pci_driver(dev->driver);
> pci_dev = to_pci_dev(dev);
> pci_dev_get(pci_dev);
> error = __pci_device_probe(drv, pci_dev);
> if (error)
> pci_dev_put(pci_dev);
> return error;
> }
> Again, doing as Manohar suggested.

Well in fact I just realised our discussion has been completely

I read the original patch again, and it does something different
to what these _get_dev functions are doing. The patch increments
the refcount of the _bridge_; the get_dev() calls increment the
functions of the _device_ itself, not the bridge, which wouldn't
protect the device against the bridge being removed.

The closest thing I saw in the kernel was usb_get_intf(),
which is what I had in mind when I wrote the original patchset
back in the day:

Sorry for overlooking this (and the subsequent noise), it's
been a while since then.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at