From: Michal Nazarewicz Date: Thu, 12 Aug 2010 15:43:50 +0000 (+0200) Subject: usb: gadget: storage: remove nofua file when unbinding X-Git-Tag: MMI-PSA29.97-13-9~22001^2~128 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=452ee0eb10bd3581cf667a1db18cb684889ce446;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Acked-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index a857b7ac238c..ab77792a4361 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c @@ -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);