Lines Matching refs:retval

458 	int			retval = 0;  in simple_io()  local
462 while (retval == 0 && iterations-- > 0) { in simple_io()
468 retval = usb_submit_urb(urb, GFP_KERNEL); in simple_io()
469 if (retval != 0) in simple_io()
475 retval = (urb->status == -ENOENT ? in simple_io()
478 retval = urb->status; in simple_io()
482 if (retval == 0 && usb_pipein(urb->pipe)) in simple_io()
483 retval = simple_check_buf(tdev, urb); in simple_io()
499 if (expected != retval) in simple_io()
502 label, iterations, retval, expected); in simple_io()
503 return retval; in simple_io()
602 int retval = 0; in perform_sglist() local
609 while (retval == 0 && iterations-- > 0) { in perform_sglist()
610 retval = usb_sg_init(req, udev, pipe, in perform_sglist()
616 if (retval) in perform_sglist()
622 retval = -ETIMEDOUT; in perform_sglist()
624 retval = req->status; in perform_sglist()
635 if (retval) in perform_sglist()
638 iterations, retval); in perform_sglist()
639 return retval; in perform_sglist()
665 int retval; in get_altsetting() local
667 retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), in get_altsetting()
671 switch (retval) { in get_altsetting()
675 retval = -ERANGE; in get_altsetting()
678 return retval; in get_altsetting()
822 int i, alt, retval; in ch9_postconfig() local
842 retval = set_altsetting(dev, alt); in ch9_postconfig()
843 if (retval) { in ch9_postconfig()
845 alt, retval); in ch9_postconfig()
846 return retval; in ch9_postconfig()
850 retval = get_altsetting(dev); in ch9_postconfig()
851 if (retval != alt) { in ch9_postconfig()
853 alt, retval); in ch9_postconfig()
854 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
867 retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), in ch9_postconfig()
871 if (retval != 1 || dev->buf[0] != expected) { in ch9_postconfig()
873 retval, dev->buf[0], expected); in ch9_postconfig()
874 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
879 retval = usb_get_descriptor(udev, USB_DT_DEVICE, 0, in ch9_postconfig()
881 if (retval != sizeof(udev->descriptor)) { in ch9_postconfig()
882 dev_err(&iface->dev, "dev descriptor --> %d\n", retval); in ch9_postconfig()
883 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
896 retval = usb_get_descriptor(udev, USB_DT_BOS, 0, dev->buf, in ch9_postconfig()
898 if (retval != sizeof(*udev->bos->desc)) { in ch9_postconfig()
899 dev_err(&iface->dev, "bos descriptor --> %d\n", retval); in ch9_postconfig()
900 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
914 retval = usb_get_descriptor(udev, USB_DT_BOS, 0, dev->buf, in ch9_postconfig()
916 if (retval != total) { in ch9_postconfig()
918 retval); in ch9_postconfig()
919 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
972 retval = usb_get_descriptor(udev, USB_DT_CONFIG, i, in ch9_postconfig()
974 if (!is_good_config(dev, retval)) { in ch9_postconfig()
977 i, retval); in ch9_postconfig()
978 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
991 retval = usb_get_descriptor(udev, in ch9_postconfig()
994 if (retval == -EPIPE) { in ch9_postconfig()
998 retval); in ch9_postconfig()
999 return retval; in ch9_postconfig()
1002 } else if (retval != sizeof(struct usb_qualifier_descriptor)) { in ch9_postconfig()
1003 dev_err(&iface->dev, "dev qualifier --> %d\n", retval); in ch9_postconfig()
1004 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
1012 retval = usb_get_descriptor(udev, in ch9_postconfig()
1015 if (!is_good_config(dev, retval)) { in ch9_postconfig()
1018 retval); in ch9_postconfig()
1019 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
1027 retval = usb_get_std_status(udev, USB_RECIP_DEVICE, 0, dev->buf); in ch9_postconfig()
1028 if (retval) { in ch9_postconfig()
1029 dev_err(&iface->dev, "get dev status --> %d\n", retval); in ch9_postconfig()
1030 return retval; in ch9_postconfig()
1037 retval = usb_get_std_status(udev, USB_RECIP_INTERFACE, in ch9_postconfig()
1039 if (retval) { in ch9_postconfig()
1040 dev_err(&iface->dev, "get interface status --> %d\n", retval); in ch9_postconfig()
1041 return retval; in ch9_postconfig()
1431 int retval = 0; in unlink1() local
1451 retval = usb_submit_urb(urb, GFP_KERNEL); in unlink1()
1452 if (retval != 0) { in unlink1()
1453 dev_err(&dev->intf->dev, "submit fail %d\n", retval); in unlink1()
1454 return retval; in unlink1()
1463 retval = usb_unlink_urb(urb); in unlink1()
1465 if (retval == 0 && usb_pipein(urb->pipe)) in unlink1()
1466 retval = simple_check_buf(dev, urb); in unlink1()
1468 switch (retval) { in unlink1()
1485 "unlink fail %d\n", retval); in unlink1()
1486 return retval; in unlink1()
1495 retval = urb->status; in unlink1()
1499 return (retval == -ECONNRESET) ? 0 : retval - 1000; in unlink1()
1501 return (retval == -ENOENT || retval == -EPERM) ? in unlink1()
1502 0 : retval - 2000; in unlink1()
1507 int retval = 0; in unlink_simple() local
1510 retval = unlink1(dev, pipe, len, 1); in unlink_simple()
1511 if (!retval) in unlink_simple()
1512 retval = unlink1(dev, pipe, len, 0); in unlink_simple()
1513 return retval; in unlink_simple()
1554 int retval = -ENOMEM; in unlink_queued() local
1563 return retval; in unlink_queued()
1588 retval = usb_submit_urb(ctx.urbs[i], GFP_KERNEL); in unlink_queued()
1589 if (retval != 0) { in unlink_queued()
1591 i, retval); in unlink_queued()
1593 ctx.status = retval; in unlink_queued()
1608 retval = ctx.status; in unlink_queued()
1616 return retval; in unlink_queued()
1623 int retval; in verify_not_halted() local
1627 retval = usb_get_std_status(urb->dev, USB_RECIP_ENDPOINT, ep, &status); in verify_not_halted()
1628 if (retval < 0) { in verify_not_halted()
1630 ep, retval); in verify_not_halted()
1631 return retval; in verify_not_halted()
1637 retval = simple_io(tdev, urb, 1, 0, 0, __func__); in verify_not_halted()
1638 if (retval != 0) in verify_not_halted()
1645 int retval; in verify_halted() local
1649 retval = usb_get_std_status(urb->dev, USB_RECIP_ENDPOINT, ep, &status); in verify_halted()
1650 if (retval < 0) { in verify_halted()
1652 ep, retval); in verify_halted()
1653 return retval; in verify_halted()
1659 retval = simple_io(tdev, urb, 1, 0, -EPIPE, __func__); in verify_halted()
1660 if (retval != -EPIPE) in verify_halted()
1662 retval = simple_io(tdev, urb, 1, 0, -EPIPE, "verify_still_halted"); in verify_halted()
1663 if (retval != -EPIPE) in verify_halted()
1670 int retval; in test_halt() local
1673 retval = verify_not_halted(tdev, ep, urb); in test_halt()
1674 if (retval < 0) in test_halt()
1675 return retval; in test_halt()
1678 retval = usb_control_msg(urb->dev, usb_sndctrlpipe(urb->dev, 0), in test_halt()
1682 if (retval < 0) { in test_halt()
1683 ERROR(tdev, "ep %02x couldn't set halt, %d\n", ep, retval); in test_halt()
1684 return retval; in test_halt()
1686 retval = verify_halted(tdev, ep, urb); in test_halt()
1687 if (retval < 0) { in test_halt()
1696 return retval; in test_halt()
1700 retval = usb_clear_halt(urb->dev, urb->pipe); in test_halt()
1701 if (retval < 0) { in test_halt()
1702 ERROR(tdev, "ep %02x couldn't clear halt, %d\n", ep, retval); in test_halt()
1703 return retval; in test_halt()
1705 retval = verify_not_halted(tdev, ep, urb); in test_halt()
1706 if (retval < 0) in test_halt()
1707 return retval; in test_halt()
1716 int retval; in test_toggle_sync() local
1719 retval = usb_clear_halt(urb->dev, urb->pipe); in test_toggle_sync()
1720 if (retval < 0) { in test_toggle_sync()
1721 ERROR(tdev, "ep %02x couldn't clear halt, %d\n", ep, retval); in test_toggle_sync()
1722 return retval; in test_toggle_sync()
1726 retval = simple_io(tdev, urb, 1, 0, 0, __func__); in test_toggle_sync()
1727 if (retval != 0) in test_toggle_sync()
1731 retval = usb_clear_halt(urb->dev, urb->pipe); in test_toggle_sync()
1732 if (retval < 0) { in test_toggle_sync()
1733 ERROR(tdev, "ep %02x couldn't clear halt, %d\n", ep, retval); in test_toggle_sync()
1734 return retval; in test_toggle_sync()
1738 retval = simple_io(tdev, urb, 1, 0, 0, __func__); in test_toggle_sync()
1740 return retval; in test_toggle_sync()
1746 int retval = 0; in halt_simple() local
1760 retval = test_halt(dev, ep, urb); in halt_simple()
1761 if (retval < 0) in halt_simple()
1768 retval = test_halt(dev, ep, urb); in halt_simple()
1772 return retval; in halt_simple()
1778 int retval = 0; in toggle_sync_simple() local
1796 retval = test_toggle_sync(dev, ep, urb); in toggle_sync_simple()
1799 return retval; in toggle_sync_simple()
1816 int retval; in ctrl_out() local
1831 retval = 0; in ctrl_out()
1840 retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), in ctrl_out()
1843 if (retval != len) { in ctrl_out()
1845 if (retval >= 0) { in ctrl_out()
1847 retval, len); in ctrl_out()
1848 retval = -EBADMSG; in ctrl_out()
1854 retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), in ctrl_out()
1857 if (retval != len) { in ctrl_out()
1859 if (retval >= 0) { in ctrl_out()
1861 retval, len); in ctrl_out()
1862 retval = -EBADMSG; in ctrl_out()
1872 retval = -EBADMSG; in ctrl_out()
1876 if (retval < 0) { in ctrl_out()
1891 if (retval < 0) in ctrl_out()
1893 what, retval, i); in ctrl_out()
1896 return retval; in ctrl_out()
2138 int retval; in test_unaligned_bulk() local
2145 retval = simple_io(tdev, urb, iterations, 0, 0, label); in test_unaligned_bulk()
2147 return retval; in test_unaligned_bulk()
2160 int retval = -EOPNOTSUPP; in usbtest_do_ioctl() local
2179 retval = 0; in usbtest_do_ioctl()
2191 retval = -ENOMEM; in usbtest_do_ioctl()
2195 retval = simple_io(dev, urb, param->iterations, 0, 0, "test1"); in usbtest_do_ioctl()
2206 retval = -ENOMEM; in usbtest_do_ioctl()
2210 retval = simple_io(dev, urb, param->iterations, 0, 0, "test2"); in usbtest_do_ioctl()
2221 retval = -ENOMEM; in usbtest_do_ioctl()
2225 retval = simple_io(dev, urb, param->iterations, param->vary, in usbtest_do_ioctl()
2237 retval = -ENOMEM; in usbtest_do_ioctl()
2241 retval = simple_io(dev, urb, param->iterations, param->vary, in usbtest_do_ioctl()
2257 retval = -ENOMEM; in usbtest_do_ioctl()
2261 retval = perform_sglist(dev, param->iterations, dev->out_pipe, in usbtest_do_ioctl()
2276 retval = -ENOMEM; in usbtest_do_ioctl()
2280 retval = perform_sglist(dev, param->iterations, dev->in_pipe, in usbtest_do_ioctl()
2294 retval = -ENOMEM; in usbtest_do_ioctl()
2298 retval = perform_sglist(dev, param->iterations, dev->out_pipe, in usbtest_do_ioctl()
2312 retval = -ENOMEM; in usbtest_do_ioctl()
2316 retval = perform_sglist(dev, param->iterations, dev->in_pipe, in usbtest_do_ioctl()
2323 retval = 0; in usbtest_do_ioctl()
2327 for (i = param->iterations; retval == 0 && i--; /* NOP */) in usbtest_do_ioctl()
2328 retval = ch9_postconfig(dev); in usbtest_do_ioctl()
2329 if (retval) in usbtest_do_ioctl()
2336 retval = 0; in usbtest_do_ioctl()
2341 retval = test_ctrl_queue(dev, param); in usbtest_do_ioctl()
2348 retval = 0; in usbtest_do_ioctl()
2351 for (i = param->iterations; retval == 0 && i--; /* NOP */) in usbtest_do_ioctl()
2352 retval = unlink_simple(dev, dev->in_pipe, in usbtest_do_ioctl()
2354 if (retval) in usbtest_do_ioctl()
2356 "iterations left %d\n", retval, i); in usbtest_do_ioctl()
2361 retval = 0; in usbtest_do_ioctl()
2364 for (i = param->iterations; retval == 0 && i--; /* NOP */) in usbtest_do_ioctl()
2365 retval = unlink_simple(dev, dev->out_pipe, in usbtest_do_ioctl()
2367 if (retval) in usbtest_do_ioctl()
2369 "iterations left %d\n", retval, i); in usbtest_do_ioctl()
2376 retval = 0; in usbtest_do_ioctl()
2379 for (i = param->iterations; retval == 0 && i--; /* NOP */) in usbtest_do_ioctl()
2380 retval = halt_simple(dev); in usbtest_do_ioctl()
2382 if (retval) in usbtest_do_ioctl()
2394 retval = ctrl_out(dev, param->iterations, in usbtest_do_ioctl()
2407 retval = test_queue(dev, param, in usbtest_do_ioctl()
2420 retval = test_queue(dev, param, in usbtest_do_ioctl()
2434 retval = test_unaligned_bulk( in usbtest_do_ioctl()
2447 retval = test_unaligned_bulk( in usbtest_do_ioctl()
2461 retval = test_unaligned_bulk( in usbtest_do_ioctl()
2474 retval = test_unaligned_bulk( in usbtest_do_ioctl()
2489 retval = ctrl_out(dev, param->iterations, in usbtest_do_ioctl()
2501 retval = test_queue(dev, param, in usbtest_do_ioctl()
2512 retval = test_queue(dev, param, in usbtest_do_ioctl()
2520 retval = 0; in usbtest_do_ioctl()
2524 for (i = param->iterations; retval == 0 && i > 0; --i) { in usbtest_do_ioctl()
2525 retval = unlink_queued(dev, dev->out_pipe, in usbtest_do_ioctl()
2527 if (retval) { in usbtest_do_ioctl()
2530 "iterations left %d\n", retval, i); in usbtest_do_ioctl()
2546 retval = -ENOMEM; in usbtest_do_ioctl()
2550 retval = simple_io(dev, urb, param->iterations, 0, 0, "test25"); in usbtest_do_ioctl()
2562 retval = -ENOMEM; in usbtest_do_ioctl()
2566 retval = simple_io(dev, urb, param->iterations, 0, 0, "test26"); in usbtest_do_ioctl()
2576 retval = test_queue(dev, param, in usbtest_do_ioctl()
2585 retval = test_queue(dev, param, in usbtest_do_ioctl()
2592 retval = 0; in usbtest_do_ioctl()
2595 for (i = param->iterations; retval == 0 && i > 0; --i) in usbtest_do_ioctl()
2596 retval = toggle_sync_simple(dev); in usbtest_do_ioctl()
2598 if (retval) in usbtest_do_ioctl()
2603 return retval; in usbtest_do_ioctl()
2640 int retval = -EOPNOTSUPP; in usbtest_ioctl() local
2657 retval = -ENODEV; in usbtest_ioctl()
2660 retval = set_altsetting(dev, dev->info->alt); in usbtest_ioctl()
2661 if (retval) { in usbtest_ioctl()
2664 dev->info->alt, retval); in usbtest_ioctl()
2683 retval = -EOPNOTSUPP; in usbtest_ioctl()
2689 retval = usbtest_do_ioctl(intf, param_32); in usbtest_ioctl()
2690 if (retval < 0) in usbtest_ioctl()
2714 return retval; in usbtest_ioctl()