usb: gadget: storage: remove nofua file when unbinding

The dev_attr_nofua file was created during fsg_bind() but
was never removed.  Made it a bit more symmetrical and added
code to remove the file in fsg_unbind().

Signed-off-by: Michal Nazarewicz <m.nazarewicz@samsung.com>
Acked-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Michal Nazarewicz 2010-08-12 17:43:50 +02:00 committed by Greg Kroah-Hartman
parent ba0534be93
commit 452ee0eb10
1 changed files with 1 additions and 0 deletions

View File

@ -3178,6 +3178,7 @@ static void /* __init_or_exit */ fsg_unbind(struct usb_gadget *gadget)
for (i = 0; i < fsg->nluns; ++i) {
curlun = &fsg->luns[i];
if (curlun->registered) {
device_remove_file(&curlun->dev, &dev_attr_nofua);
device_remove_file(&curlun->dev, &dev_attr_ro);
device_remove_file(&curlun->dev, &dev_attr_file);
fsg_lun_close(curlun);