On Mon, Aug 15, 2011 at 12:05:03 +0200, Manohar Vanga wrote:
> > If the driver doesn't provide a .probe, we would still increment
> > the refcount of the bridge module. Is that reasonable? I dunno.
(snip)
> I picked this default behaviour from the PCI driver code 
> (drivers/pci/pci-driver.c):
> 
>       static int pci_device_probe(struct device * dev)
>       {
>               ...
>               pci_dev_get(pci_dev);
>               error = __pci_device_probe(drv, pci_dev);
>               if (error)
>                       pci_dev_put(pci_dev);
>       
>               return error;
>       }
> 
> The __pci_device_probe() function checks if probe is present or not.

There is a subtle difference here; pci_dev is the _struct pci_device
of the device_ being probed, and pci_dev_get increments its refcount.

In our case vme_bridge_get increments the refcount of the _bridge's
module_; my concern was that if there was no .probe (which would
only happen with a few special drivers), we'd increment the refcount
of the bridge for perhaps no reason.

Anyway we don't have such esoteric drivers yet, so I wouldn't worry
about this too much.

                Emilio
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to