usb: gadget: storage: remove nofua file when unbinding
authorMichal Nazarewicz <m.nazarewicz@samsung.com>
Thu, 12 Aug 2010 15:43:50 +0000 (17:43 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 22 Oct 2010 17:21:22 +0000 (10:21 -0700)
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>
drivers/usb/gadget/file_storage.c

index a857b7ac238c6145d8d3c265c420c6890ee63cb0..ab77792a43614dc9a982b435e61cb8d0046101b5 100644 (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);