Re: [PATCH 3/5] staging: vme: add functions for bridge module refcounting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux