Skip to content

Commit

Permalink
usb: musb: debugfs: musb_exit_debugfs() can be called on probe
Browse files Browse the repository at this point in the history
when we fail to probe(), we can call musb_exit_debugfs().
Allow that by removing section annotations.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Felipe Balbi authored and Greg Kroah-Hartman committed May 20, 2010
1 parent e618834 commit b0f9da7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions drivers/usb/musb/musb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2056,12 +2056,12 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)

status = musb_init_debugfs(musb);
if (status < 0)
goto fail2;
goto fail4;

#ifdef CONFIG_SYSFS
status = sysfs_create_group(&musb->controller->kobj, &musb_attr_group);
if (status)
goto fail4;
goto fail5;
#endif

dev_info(dev, "USB %s mode controller at %p using %s, IRQ %d\n",
Expand All @@ -2078,6 +2078,9 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)

return 0;

fail5:
musb_exit_debugfs(musb);

fail4:
if (!is_otg_enabled(musb) && is_host_enabled(musb))
usb_remove_hcd(musb_to_hcd(musb));
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/musb/musb_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ int __init musb_init_debugfs(struct musb *musb)
return ret;
}

void __exit musb_exit_debugfs(struct musb *musb)
void /* __init_or_exit */ musb_exit_debugfs(struct musb *musb)
{
debugfs_remove_recursive(musb_debugfs_root);
}

0 comments on commit b0f9da7

Please sign in to comment.