usb: musb: remove dead code from procfs

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, October 17, 2008 - 5:05 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=28c2c5...
Commit:     28c2c51c078296151549f4f0e823e804f773861b
Parent:     458e6a511f9dc91e5af5e64740b0a5c9650a25fb
Author:     Felipe Balbi <felipe.balbi@nokia.com>
AuthorDate: Thu Sep 11 11:53:25 2008 +0300
Committer:  Greg Kroah-Hartman <gregkh@suse.de>
CommitDate: Fri Oct 17 14:40:59 2008 -0700

    usb: musb: remove dead code from procfs
    
    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 |   32 +++++++++++++++++++++-----------
 1 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index d5af6b0..4a35745 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2055,15 +2055,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);
@@ -2072,12 +2063,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;
+
 }
 
 /*-------------------------------------------------------------------------*/
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
usb: musb: remove dead code from procfs, Linux Kernel Mailing ..., (Fri Oct 17, 5:05 pm)