summaryrefslogtreecommitdiffstats
path: root/usbmuxd/usb-linux.c
diff options
context:
space:
mode:
authorGravatar Hector Martin2009-08-19 01:39:16 +0200
committerGravatar Hector Martin2009-08-19 03:56:09 +0200
commitacfba6464bd57bdd0549f083f83b12ff9909337f (patch)
tree824f942e9ffef08d241d268f407c9b4ccd19f785 /usbmuxd/usb-linux.c
parent3a6f72edfb352ab57f58fb4fe4b6314daaddb362 (diff)
downloadusbmuxd-acfba6464bd57bdd0549f083f83b12ff9909337f.tar.gz
usbmuxd-acfba6464bd57bdd0549f083f83b12ff9909337f.tar.bz2
Remove trailing whitespace errors
Diffstat (limited to 'usbmuxd/usb-linux.c')
-rw-r--r--usbmuxd/usb-linux.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/usbmuxd/usb-linux.c b/usbmuxd/usb-linux.c
index a5fc6a0..6e99a95 100644
--- a/usbmuxd/usb-linux.c
+++ b/usbmuxd/usb-linux.c
@@ -58,7 +58,7 @@ static void usb_disconnect(struct usb_device *dev)
58 if(!dev->dev) { 58 if(!dev->dev) {
59 return; 59 return;
60 } 60 }
61 61
62 // kill the rx xfer and tx xfers and try to make sure the callbacks get called before we free the device 62 // kill the rx xfer and tx xfers and try to make sure the callbacks get called before we free the device
63 if(dev->rx_xfer) { 63 if(dev->rx_xfer) {
64 usbmuxd_log(LL_DEBUG, "usb_disconnect: cancelling RX xfer"); 64 usbmuxd_log(LL_DEBUG, "usb_disconnect: cancelling RX xfer");
@@ -72,7 +72,7 @@ static void usb_disconnect(struct usb_device *dev)
72 while(dev->rx_xfer || collection_count(&dev->tx_xfers)) { 72 while(dev->rx_xfer || collection_count(&dev->tx_xfers)) {
73 struct timeval tv; 73 struct timeval tv;
74 int res; 74 int res;
75 75
76 tv.tv_sec = 0; 76 tv.tv_sec = 0;
77 tv.tv_usec = 1000; 77 tv.tv_usec = 1000;
78 if((res = libusb_handle_events_timeout(NULL, &tv)) < 0) { 78 if((res = libusb_handle_events_timeout(NULL, &tv)) < 0) {
@@ -218,7 +218,7 @@ static int usb_discover(void)
218 int cnt, i, res; 218 int cnt, i, res;
219 int valid_count = 0; 219 int valid_count = 0;
220 libusb_device **devs; 220 libusb_device **devs;
221 221
222 cnt = libusb_get_device_list(NULL, &devs); 222 cnt = libusb_get_device_list(NULL, &devs);
223 if(cnt < 0) { 223 if(cnt < 0) {
224 usbmuxd_log(LL_WARNING, "Could not get device list: %d", cnt); 224 usbmuxd_log(LL_WARNING, "Could not get device list: %d", cnt);
@@ -309,7 +309,7 @@ static int usb_discover(void)
309 collection_init(&usbdev->tx_xfers); 309 collection_init(&usbdev->tx_xfers);
310 310
311 collection_add(&device_list, usbdev); 311 collection_add(&device_list, usbdev);
312 312
313 if(device_add(usbdev) < 0) { 313 if(device_add(usbdev) < 0) {
314 usb_disconnect(usbdev); 314 usb_disconnect(usbdev);
315 continue; 315 continue;
@@ -327,14 +327,14 @@ static int usb_discover(void)
327 usb_disconnect(usbdev); 327 usb_disconnect(usbdev);
328 } 328 }
329 } ENDFOREACH 329 } ENDFOREACH
330 330
331 libusb_free_device_list(devs, 1); 331 libusb_free_device_list(devs, 1);
332 332
333 gettimeofday(&next_dev_poll_time, NULL); 333 gettimeofday(&next_dev_poll_time, NULL);
334 next_dev_poll_time.tv_usec += DEVICE_POLL_TIME * 1000; 334 next_dev_poll_time.tv_usec += DEVICE_POLL_TIME * 1000;
335 next_dev_poll_time.tv_sec += next_dev_poll_time.tv_usec / 1000000; 335 next_dev_poll_time.tv_sec += next_dev_poll_time.tv_usec / 1000000;
336 next_dev_poll_time.tv_usec = next_dev_poll_time.tv_usec % 1000000; 336 next_dev_poll_time.tv_usec = next_dev_poll_time.tv_usec % 1000000;
337 337
338 return valid_count; 338 return valid_count;
339} 339}
340 340
@@ -477,7 +477,7 @@ int usb_init(void)
477{ 477{
478 int res; 478 int res;
479 usbmuxd_log(LL_DEBUG, "usb_init for linux / libusb 1.0"); 479 usbmuxd_log(LL_DEBUG, "usb_init for linux / libusb 1.0");
480 480
481 devlist_failures = 0; 481 devlist_failures = 0;
482 res = libusb_init(NULL); 482 res = libusb_init(NULL);
483 //libusb_set_debug(NULL, 3); 483 //libusb_set_debug(NULL, 3);
@@ -485,9 +485,9 @@ int usb_init(void)
485 usbmuxd_log(LL_FATAL, "libusb_init failed: %d", res); 485 usbmuxd_log(LL_FATAL, "libusb_init failed: %d", res);
486 return -1; 486 return -1;
487 } 487 }
488 488
489 collection_init(&device_list); 489 collection_init(&device_list);
490 490
491 return usb_discover(); 491 return usb_discover();
492} 492}
493 493