Michal Nazarewicz 9c61021337 USB: g_mass_storage: fsg_common_init() created
Moved code initialising fsg_common structure to fsg_common_init()
function which is called from fsg_bind().  Moreover, changed
reference counting mechanism: fsg_common has a reference counter
which counts how many fsg_dev structures uses it.  When this
reaches zero fsg_common_release() is run which unregisters
LUN devices and frees memory.

fsg_common_init() takes pointer to fsg_common structure as an
argument.  If it is NULL function allocates storage otherwise
uses pointed to memory (handy if fsg_common is a field of another
structure or a static variable).

fsg_common_release() will free storage only if
free_storage_on_release is set -- it is initialised by
fsg_common_init(): set if allocation was done, unset
otherwise (one may overwrite it of course).

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 11:55:19 -08:00
..
2009-12-11 11:55:15 -08:00
2009-01-07 09:59:58 -08:00
2008-10-22 10:05:28 -07:00
2009-09-23 06:46:35 -07:00
2009-09-23 18:13:10 -07:00
2009-09-23 18:13:10 -07:00
2009-09-23 06:46:35 -07:00
2009-09-23 18:13:10 -07:00
2009-10-04 15:05:10 -07:00
2009-10-21 13:20:32 +01:00
2009-07-12 12:22:34 -07:00
2008-07-21 15:16:10 -07:00
2009-09-23 06:46:35 -07:00
2009-09-23 06:46:35 -07:00
2009-09-23 18:13:10 -07:00
2009-09-23 18:13:10 -07:00
2009-09-23 06:46:35 -07:00
2008-10-17 14:40:53 -07:00