diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-05-22 11:50:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-12 19:29:49 -0400 |
commit | 20dfdad74a2baabeecc2896c770efcbf698b9b8d (patch) | |
tree | 16bfece87f73b07a89a857ca8d31166590f36d03 | |
parent | d4ead16f50f9ad30bdc7276ec8fee7a24c72f294 (diff) |
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: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/core/driver.c | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 02d6db61c940..6c62a6d91484 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -29,6 +29,14 @@ | |||
29 | #include "hcd.h" | 29 | #include "hcd.h" |
30 | #include "usb.h" | 30 | #include "usb.h" |
31 | 31 | ||
32 | #define VERBOSE_DEBUG 0 | ||
33 | |||
34 | #if VERBOSE_DEBUG | ||
35 | #define dev_vdbg dev_dbg | ||
36 | #else | ||
37 | #define dev_vdbg(dev, fmt, args...) do { } while (0) | ||
38 | #endif | ||
39 | |||
32 | #ifdef CONFIG_HOTPLUG | 40 | #ifdef CONFIG_HOTPLUG |
33 | 41 | ||
34 | /* | 42 | /* |
@@ -812,8 +820,8 @@ static int usb_suspend_device(struct usb_device *udev, pm_message_t msg) | |||
812 | } | 820 | } |
813 | status = udriver->suspend(udev, msg); | 821 | status = udriver->suspend(udev, msg); |
814 | 822 | ||
815 | done: | 823 | done: |
816 | // dev_dbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); | 824 | dev_vdbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); |
817 | if (status == 0) | 825 | if (status == 0) |
818 | udev->dev.power.power_state.event = msg.event; | 826 | udev->dev.power.power_state.event = msg.event; |
819 | return status; | 827 | return status; |
@@ -842,8 +850,8 @@ static int usb_resume_device(struct usb_device *udev) | |||
842 | udriver = to_usb_device_driver(udev->dev.driver); | 850 | udriver = to_usb_device_driver(udev->dev.driver); |
843 | status = udriver->resume(udev); | 851 | status = udriver->resume(udev); |
844 | 852 | ||
845 | done: | 853 | done: |
846 | // dev_dbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); | 854 | dev_vdbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); |
847 | if (status == 0) { | 855 | if (status == 0) { |
848 | udev->autoresume_disabled = 0; | 856 | udev->autoresume_disabled = 0; |
849 | udev->dev.power.power_state.event = PM_EVENT_ON; | 857 | 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 | mark_quiesced(intf); | 889 | mark_quiesced(intf); |
882 | } | 890 | } |
883 | 891 | ||
884 | done: | 892 | done: |
885 | // dev_dbg(&intf->dev, "%s: status %d\n", __FUNCTION__, status); | 893 | dev_vdbg(&intf->dev, "%s: status %d\n", __FUNCTION__, status); |
886 | return status; | 894 | return status; |
887 | } | 895 | } |
888 | 896 | ||
@@ -919,7 +927,7 @@ static int usb_resume_interface(struct usb_interface *intf, int reset_resume) | |||
919 | driver->name); | 927 | driver->name); |
920 | 928 | ||
921 | done: | 929 | done: |
922 | // dev_dbg(&intf->dev, "%s: status %d\n", __FUNCTION__, status); | 930 | dev_vdbg(&intf->dev, "%s: status %d\n", __FUNCTION__, status); |
923 | if (status == 0) | 931 | if (status == 0) |
924 | mark_active(intf); | 932 | mark_active(intf); |
925 | return status; | 933 | return status; |
@@ -1083,7 +1091,7 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) | |||
1083 | } | 1091 | } |
1084 | 1092 | ||
1085 | done: | 1093 | done: |
1086 | // dev_dbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); | 1094 | dev_vdbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); |
1087 | return status; | 1095 | return status; |
1088 | } | 1096 | } |
1089 | 1097 | ||
@@ -1180,7 +1188,7 @@ static int usb_resume_both(struct usb_device *udev) | |||
1180 | } | 1188 | } |
1181 | 1189 | ||
1182 | done: | 1190 | done: |
1183 | // dev_dbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); | 1191 | dev_vdbg(&udev->dev, "%s: status %d\n", __FUNCTION__, status); |
1184 | udev->reset_resume = 0; | 1192 | udev->reset_resume = 0; |
1185 | return status; | 1193 | return status; |
1186 | } | 1194 | } |
@@ -1248,8 +1256,8 @@ void usb_autosuspend_device(struct usb_device *udev) | |||
1248 | int status; | 1256 | int status; |
1249 | 1257 | ||
1250 | status = usb_autopm_do_device(udev, -1); | 1258 | status = usb_autopm_do_device(udev, -1); |
1251 | // dev_dbg(&udev->dev, "%s: cnt %d\n", | 1259 | dev_vdbg(&udev->dev, "%s: cnt %d\n", |
1252 | // __FUNCTION__, udev->pm_usage_cnt); | 1260 | __FUNCTION__, udev->pm_usage_cnt); |
1253 | } | 1261 | } |
1254 | 1262 | ||
1255 | /** | 1263 | /** |
@@ -1268,8 +1276,8 @@ void usb_autosuspend_device(struct usb_device *udev) | |||
1268 | void usb_try_autosuspend_device(struct usb_device *udev) | 1276 | void usb_try_autosuspend_device(struct usb_device *udev) |
1269 | { | 1277 | { |
1270 | usb_autopm_do_device(udev, 0); | 1278 | usb_autopm_do_device(udev, 0); |
1271 | // dev_dbg(&udev->dev, "%s: cnt %d\n", | 1279 | dev_vdbg(&udev->dev, "%s: cnt %d\n", |
1272 | // __FUNCTION__, udev->pm_usage_cnt); | 1280 | __FUNCTION__, udev->pm_usage_cnt); |
1273 | } | 1281 | } |
1274 | 1282 | ||
1275 | /** | 1283 | /** |
@@ -1296,8 +1304,8 @@ int usb_autoresume_device(struct usb_device *udev) | |||
1296 | int status; | 1304 | int status; |
1297 | 1305 | ||
1298 | status = usb_autopm_do_device(udev, 1); | 1306 | status = usb_autopm_do_device(udev, 1); |
1299 | // dev_dbg(&udev->dev, "%s: status %d cnt %d\n", | 1307 | dev_vdbg(&udev->dev, "%s: status %d cnt %d\n", |
1300 | // __FUNCTION__, status, udev->pm_usage_cnt); | 1308 | __FUNCTION__, status, udev->pm_usage_cnt); |
1301 | return status; | 1309 | return status; |
1302 | } | 1310 | } |
1303 | 1311 | ||
@@ -1369,8 +1377,8 @@ void usb_autopm_put_interface(struct usb_interface *intf) | |||
1369 | int status; | 1377 | int status; |
1370 | 1378 | ||
1371 | status = usb_autopm_do_interface(intf, -1); | 1379 | status = usb_autopm_do_interface(intf, -1); |
1372 | // dev_dbg(&intf->dev, "%s: status %d cnt %d\n", | 1380 | dev_vdbg(&intf->dev, "%s: status %d cnt %d\n", |
1373 | // __FUNCTION__, status, intf->pm_usage_cnt); | 1381 | __FUNCTION__, status, intf->pm_usage_cnt); |
1374 | } | 1382 | } |
1375 | EXPORT_SYMBOL_GPL(usb_autopm_put_interface); | 1383 | EXPORT_SYMBOL_GPL(usb_autopm_put_interface); |
1376 | 1384 | ||
@@ -1413,8 +1421,8 @@ int usb_autopm_get_interface(struct usb_interface *intf) | |||
1413 | int status; | 1421 | int status; |
1414 | 1422 | ||
1415 | status = usb_autopm_do_interface(intf, 1); | 1423 | status = usb_autopm_do_interface(intf, 1); |
1416 | // dev_dbg(&intf->dev, "%s: status %d cnt %d\n", | 1424 | dev_vdbg(&intf->dev, "%s: status %d cnt %d\n", |
1417 | // __FUNCTION__, status, intf->pm_usage_cnt); | 1425 | __FUNCTION__, status, intf->pm_usage_cnt); |
1418 | return status; | 1426 | return status; |
1419 | } | 1427 | } |
1420 | EXPORT_SYMBOL_GPL(usb_autopm_get_interface); | 1428 | EXPORT_SYMBOL_GPL(usb_autopm_get_interface); |
@@ -1435,8 +1443,8 @@ int usb_autopm_set_interface(struct usb_interface *intf) | |||
1435 | int status; | 1443 | int status; |
1436 | 1444 | ||
1437 | status = usb_autopm_do_interface(intf, 0); | 1445 | status = usb_autopm_do_interface(intf, 0); |
1438 | // dev_dbg(&intf->dev, "%s: status %d cnt %d\n", | 1446 | dev_vdbg(&intf->dev, "%s: status %d cnt %d\n", |
1439 | // __FUNCTION__, status, intf->pm_usage_cnt); | 1447 | __FUNCTION__, status, intf->pm_usage_cnt); |
1440 | return status; | 1448 | return status; |
1441 | } | 1449 | } |
1442 | EXPORT_SYMBOL_GPL(usb_autopm_set_interface); | 1450 | EXPORT_SYMBOL_GPL(usb_autopm_set_interface); |