提交 20dfdad7 编写于 作者: A Alan Stern 提交者: Greg Kroah-Hartman

USB: rework C++-style comments

This patch (as911) replaces some C++-style commented-out debugging
lines in driver.c with a new "verbose debugging" macro.  It makes the
code look cleaner, and it's easier to turn the debugging on or off.
Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 d4ead16f
...@@ -29,6 +29,14 @@ ...@@ -29,6 +29,14 @@
#include "hcd.h" #include "hcd.h"
#include "usb.h" #include "usb.h"
#define VERBOSE_DEBUG 0
#if VERBOSE_DEBUG
#define dev_vdbg dev_dbg
#else
#define dev_vdbg(dev, fmt, args...) do { } while (0)
#endif
#ifdef CONFIG_HOTPLUG #ifdef CONFIG_HOTPLUG
/* /*
...@@ -812,8 +820,8 @@ static int usb_suspend_device(struct usb_device *udev, pm_message_t msg) ...@@ -812,8 +820,8 @@ static int usb_suspend_device(struct usb_device *udev, pm_message_t msg)
} }
status = udriver->suspend(udev, msg); status = udriver->suspend(udev, msg);
done: done:
// dev_dbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); dev_vdbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status);
if (status == 0) if (status == 0)
udev->dev.power.power_state.event = msg.event; udev->dev.power.power_state.event = msg.event;
return status; return status;
...@@ -842,8 +850,8 @@ static int usb_resume_device(struct usb_device *udev) ...@@ -842,8 +850,8 @@ static int usb_resume_device(struct usb_device *udev)
udriver = to_usb_device_driver(udev->dev.driver); udriver = to_usb_device_driver(udev->dev.driver);
status = udriver->resume(udev); status = udriver->resume(udev);
done: done:
// dev_dbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); dev_vdbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status);
if (status == 0) { if (status == 0) {
udev->autoresume_disabled = 0; udev->autoresume_disabled = 0;
udev->dev.power.power_state.event = PM_EVENT_ON; udev->dev.power.power_state.event = PM_EVENT_ON;
...@@ -881,8 +889,8 @@ static int usb_suspend_interface(struct usb_interface *intf, pm_message_t msg) ...@@ -881,8 +889,8 @@ static int usb_suspend_interface(struct usb_interface *intf, pm_message_t msg)
mark_quiesced(intf); mark_quiesced(intf);
} }
done: done:
// dev_dbg(&intf->dev, "%s: status %d\n", __FUNCTION__, status); dev_vdbg(&intf->dev, "%s: status %d\n", __FUNCTION__, status);
return status; return status;
} }
...@@ -919,7 +927,7 @@ static int usb_resume_interface(struct usb_interface *intf, int reset_resume) ...@@ -919,7 +927,7 @@ static int usb_resume_interface(struct usb_interface *intf, int reset_resume)
driver->name); driver->name);
done: done:
// dev_dbg(&intf->dev, "%s: status %d\n", __FUNCTION__, status); dev_vdbg(&intf->dev, "%s: status %d\n", __FUNCTION__, status);
if (status == 0) if (status == 0)
mark_active(intf); mark_active(intf);
return status; return status;
...@@ -1083,7 +1091,7 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) ...@@ -1083,7 +1091,7 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
} }
done: done:
// dev_dbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); dev_vdbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status);
return status; return status;
} }
...@@ -1180,7 +1188,7 @@ static int usb_resume_both(struct usb_device *udev) ...@@ -1180,7 +1188,7 @@ static int usb_resume_both(struct usb_device *udev)
} }
done: done:
// dev_dbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); dev_vdbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status);
udev->reset_resume = 0; udev->reset_resume = 0;
return status; return status;
} }
...@@ -1248,8 +1256,8 @@ void usb_autosuspend_device(struct usb_device *udev) ...@@ -1248,8 +1256,8 @@ void usb_autosuspend_device(struct usb_device *udev)
int status; int status;
status = usb_autopm_do_device(udev, -1); status = usb_autopm_do_device(udev, -1);
// dev_dbg(&udev->dev, "%s: cnt %d\n", dev_vdbg(&udev->dev, "%s: cnt %d\n",
// __FUNCTION__, udev->pm_usage_cnt); __FUNCTION__, udev->pm_usage_cnt);
} }
/** /**
...@@ -1268,8 +1276,8 @@ void usb_autosuspend_device(struct usb_device *udev) ...@@ -1268,8 +1276,8 @@ void usb_autosuspend_device(struct usb_device *udev)
void usb_try_autosuspend_device(struct usb_device *udev) void usb_try_autosuspend_device(struct usb_device *udev)
{ {
usb_autopm_do_device(udev, 0); usb_autopm_do_device(udev, 0);
// dev_dbg(&udev->dev, "%s: cnt %d\n", dev_vdbg(&udev->dev, "%s: cnt %d\n",
// __FUNCTION__, udev->pm_usage_cnt); __FUNCTION__, udev->pm_usage_cnt);
} }
/** /**
...@@ -1296,8 +1304,8 @@ int usb_autoresume_device(struct usb_device *udev) ...@@ -1296,8 +1304,8 @@ int usb_autoresume_device(struct usb_device *udev)
int status; int status;
status = usb_autopm_do_device(udev, 1); status = usb_autopm_do_device(udev, 1);
// dev_dbg(&udev->dev, "%s: status %d cnt %d\n", dev_vdbg(&udev->dev, "%s: status %d cnt %d\n",
// __FUNCTION__, status, udev->pm_usage_cnt); __FUNCTION__, status, udev->pm_usage_cnt);
return status; return status;
} }
...@@ -1369,8 +1377,8 @@ void usb_autopm_put_interface(struct usb_interface *intf) ...@@ -1369,8 +1377,8 @@ void usb_autopm_put_interface(struct usb_interface *intf)
int status; int status;
status = usb_autopm_do_interface(intf, -1); status = usb_autopm_do_interface(intf, -1);
// dev_dbg(&intf->dev, "%s: status %d cnt %d\n", dev_vdbg(&intf->dev, "%s: status %d cnt %d\n",
// __FUNCTION__, status, intf->pm_usage_cnt); __FUNCTION__, status, intf->pm_usage_cnt);
} }
EXPORT_SYMBOL_GPL(usb_autopm_put_interface); EXPORT_SYMBOL_GPL(usb_autopm_put_interface);
...@@ -1413,8 +1421,8 @@ int usb_autopm_get_interface(struct usb_interface *intf) ...@@ -1413,8 +1421,8 @@ int usb_autopm_get_interface(struct usb_interface *intf)
int status; int status;
status = usb_autopm_do_interface(intf, 1); status = usb_autopm_do_interface(intf, 1);
// dev_dbg(&intf->dev, "%s: status %d cnt %d\n", dev_vdbg(&intf->dev, "%s: status %d cnt %d\n",
// __FUNCTION__, status, intf->pm_usage_cnt); __FUNCTION__, status, intf->pm_usage_cnt);
return status; return status;
} }
EXPORT_SYMBOL_GPL(usb_autopm_get_interface); EXPORT_SYMBOL_GPL(usb_autopm_get_interface);
...@@ -1435,8 +1443,8 @@ int usb_autopm_set_interface(struct usb_interface *intf) ...@@ -1435,8 +1443,8 @@ int usb_autopm_set_interface(struct usb_interface *intf)
int status; int status;
status = usb_autopm_do_interface(intf, 0); status = usb_autopm_do_interface(intf, 0);
// dev_dbg(&intf->dev, "%s: status %d cnt %d\n", dev_vdbg(&intf->dev, "%s: status %d cnt %d\n",
// __FUNCTION__, status, intf->pm_usage_cnt); __FUNCTION__, status, intf->pm_usage_cnt);
return status; return status;
} }
EXPORT_SYMBOL_GPL(usb_autopm_set_interface); EXPORT_SYMBOL_GPL(usb_autopm_set_interface);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册