aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>2013-03-30 06:53:53 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-30 11:08:39 -0400
commitadf0f735e61aae5ff615bb0301d9fff29b589a5c (patch)
treeb55bd577247cbcf5f3a297dfe263c29c2b4678d0
parentc8e333a3b17050800a5aa536feb628f18d2a01a2 (diff)
usb: chipidea: move debug files creation/removal to the core
Create and remove debugfs entries in hdrc probe/remove instead of start/stop of the device controller. Gadget specific will not export anything while the controller is in host mode. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/chipidea/core.c6
-rw-r--r--drivers/usb/chipidea/udc.c9
2 files changed, 6 insertions, 9 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 5270156591e0..a7ce1b8c8fd7 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -455,8 +455,11 @@ static int ci_hdrc_probe(struct platform_device *pdev)
455 if (ci->is_otg) 455 if (ci->is_otg)
456 hw_write(ci, OP_OTGSC, OTGSC_IDIE, OTGSC_IDIE); 456 hw_write(ci, OP_OTGSC, OTGSC_IDIE, OTGSC_IDIE);
457 457
458 return ret; 458 ret = dbg_create_files(ci);
459 if (!ret)
460 return 0;
459 461
462 free_irq(ci->irq, ci);
460stop: 463stop:
461 ci_role_stop(ci); 464 ci_role_stop(ci);
462rm_wq: 465rm_wq:
@@ -470,6 +473,7 @@ static int ci_hdrc_remove(struct platform_device *pdev)
470{ 473{
471 struct ci13xxx *ci = platform_get_drvdata(pdev); 474 struct ci13xxx *ci = platform_get_drvdata(pdev);
472 475
476 dbg_remove_files(ci);
473 flush_workqueue(ci->wq); 477 flush_workqueue(ci->wq);
474 destroy_workqueue(ci->wq); 478 destroy_workqueue(ci->wq);
475 free_irq(ci->irq, ci); 479 free_irq(ci->irq, ci);
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index d945391e3c6c..28c31baebfde 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1697,15 +1697,11 @@ static int udc_start(struct ci13xxx *ci)
1697 goto put_transceiver; 1697 goto put_transceiver;
1698 } 1698 }
1699 1699
1700 retval = dbg_create_files(ci);
1701 if (retval)
1702 goto unreg_device;
1703
1704 if (!IS_ERR_OR_NULL(ci->transceiver)) { 1700 if (!IS_ERR_OR_NULL(ci->transceiver)) {
1705 retval = otg_set_peripheral(ci->transceiver->otg, 1701 retval = otg_set_peripheral(ci->transceiver->otg,
1706 &ci->gadget); 1702 &ci->gadget);
1707 if (retval) 1703 if (retval)
1708 goto remove_dbg; 1704 goto unreg_device;
1709 } 1705 }
1710 1706
1711 retval = usb_add_gadget_udc(dev, &ci->gadget); 1707 retval = usb_add_gadget_udc(dev, &ci->gadget);
@@ -1725,8 +1721,6 @@ remove_trans:
1725 } 1721 }
1726 1722
1727 dev_err(dev, "error = %i\n", retval); 1723 dev_err(dev, "error = %i\n", retval);
1728remove_dbg:
1729 dbg_remove_files(ci);
1730unreg_device: 1724unreg_device:
1731 device_unregister(&ci->gadget.dev); 1725 device_unregister(&ci->gadget.dev);
1732put_transceiver: 1726put_transceiver:
@@ -1763,7 +1757,6 @@ static void udc_stop(struct ci13xxx *ci)
1763 if (ci->global_phy) 1757 if (ci->global_phy)
1764 usb_put_phy(ci->transceiver); 1758 usb_put_phy(ci->transceiver);
1765 } 1759 }
1766 dbg_remove_files(ci);
1767 device_unregister(&ci->gadget.dev); 1760 device_unregister(&ci->gadget.dev);
1768 /* my kobject is dynamic, I swear! */ 1761 /* my kobject is dynamic, I swear! */
1769 memset(&ci->gadget, 0, sizeof(ci->gadget)); 1762 memset(&ci->gadget, 0, sizeof(ci->gadget));