usb: musb: remove dead code from procfs
authorFelipe Balbi <felipe.balbi@nokia.com>
Thu, 11 Sep 2008 08:53:25 +0000 (11:53 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sat, 21 Nov 2009 21:24:55 +0000 (23:24 +0200)
When removing the procfs file, I forgot to remove some
code that created and removed that file. Here's a patch
to fix it. Ideally this patch will be melded into the patch
removing the procfs file, don't know if it's possible still.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/musb/musb_core.c

index 128e949..f7b5a1a 100644 (file)
@@ -2054,15 +2054,6 @@ bad_config:
 
        }
 
-       return 0;
-
-fail:
-       if (musb->clock)
-               clk_put(musb->clock);
-       device_init_wakeup(dev, 0);
-       musb_free(musb);
-       return status;
-
 #ifdef CONFIG_SYSFS
        status = device_create_file(dev, &dev_attr_mode);
        status = device_create_file(dev, &dev_attr_vbus);
@@ -2071,12 +2062,31 @@ fail:
 #endif /* CONFIG_USB_GADGET_MUSB_HDRC */
        status = 0;
 #endif
+       if (status)
+               goto fail2;
 
-       return status;
+       return 0;
 
 fail2:
+#ifdef CONFIG_SYSFS
+       device_remove_file(musb->controller, &dev_attr_mode);
+       device_remove_file(musb->controller, &dev_attr_vbus);
+#ifdef CONFIG_USB_MUSB_OTG
+       device_remove_file(musb->controller, &dev_attr_srp);
+#endif
+#endif
        musb_platform_exit(musb);
-       goto fail;
+fail:
+       dev_err(musb->controller,
+               "musb_init_controller failed with status %d\n", status);
+
+       if (musb->clock)
+               clk_put(musb->clock);
+       device_init_wakeup(dev, 0);
+       musb_free(musb);
+
+       return status;
+
 }
 
 /*-------------------------------------------------------------------------*/