On Mon, 2011-11-14 at 13:54 -0700, Alex Williamson wrote: > On Fri, 2011-11-11 at 18:14 -0600, Scott Wood wrote: > > On 11/03/2011 03:12 PM, Alex Williamson wrote: > > > + int (*get)(void *); > > > + void (*put)(void *); > > > + ssize_t (*read)(void *, char __user *, > > > + size_t, loff_t *); > > > + ssize_t (*write)(void *, const char __user *, > > > + size_t, loff_t *); > > > + long (*ioctl)(void *, unsigned int, unsigned long); > > > + int (*mmap)(void *, struct vm_area_struct *); > > > +}; > > > > When defining an API, please do not omit parameter names. > > ok > > > Should specify what the driver is supposed to do with get/put -- I guess > > not try to unbind when the count is nonzero? Races could still lead the > > unbinder to be blocked, but I guess it lets the driver know when it's > > likely to succeed. > > Right, for the pci bus driver, it's mainly for reference counting, > including the module_get to prevent vfio-pci from being unloaded. On > the first get for a device, we also do a pci_enable() and pci_disable() > on last put. I'll try to clarify in the docs. Looking at these again, I should just rename them to open/release. That matches the points when they're called. I suspect I started with just reference counting and it grew to more of a full blown open/release. Thanks, Alex -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html