On Tue, Dec 04, 2001 at 01:18:37PM -0800, Chris Rankin wrote: > Hi, > > I recently saw an article in Linux Journal about writing a USB device > driver. One thing that leapt out at me was that the skeleton driver > code called MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT in the > file_operations open and release methods. Aren't these macros Linux > 2.2-isms that have been made redundant by the file_operations.owner > field? Since the owner field is already correctly set to THIS_MODULE, > I have attached a patch to remove the MOD_XXX_USE_COUNT macro > calls. After all, asking a module to lock itself has an implicit race > condition.
Well some modules are forced to lock themselves as the upper layers have not implemented the same logic that the network and filesystem layers have (like tty). This patch is correct, but I think I'll leave it alone for now. It's a teaching module, and the placement of the MOD_INC and MOD_DEC locations are correct if you have to implement them yourself. But a patch stating that they are not needed if you are writing a driver for a subsystem that handles the module locking would be appreciated. thanks, greg k-h _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
