]> git.baikalelectronics.ru Git - kernel.git/commit
USB: gadget: f_mass_storage: use static attribute groups for sysfs entries
authorTakashi Iwai <tiwai@suse.de>
Thu, 5 Feb 2015 13:36:25 +0000 (14:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2015 15:56:40 +0000 (16:56 +0100)
commite75ba3582afb79b3cd1a815dcce6b6c6de729094
tree999efbb33221c8be8d8b691cf24512c04c177cc4
parent17fe1246b78f785afb8721b030eec516a58d46aa
USB: gadget: f_mass_storage: use static attribute groups for sysfs entries

Instead of manual device_create_file() and device_remove_file() calls,
assign the static attribute groups to the lun device to register.
The RO or RW permissions for some entries are decided in is_visible
callback.  This simplifies the code (also the logic) and avoids the
possible races, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_mass_storage.c