Lines Matching refs:retval

466 	int			retval = 0;  in simple_io()  local
470 while (retval == 0 && iterations-- > 0) { in simple_io()
476 retval = usb_submit_urb(urb, GFP_KERNEL); in simple_io()
477 if (retval != 0) in simple_io()
483 retval = (urb->status == -ENOENT ? in simple_io()
486 retval = urb->status; in simple_io()
490 if (retval == 0 && usb_pipein(urb->pipe)) in simple_io()
491 retval = simple_check_buf(tdev, urb); in simple_io()
507 if (expected != retval) in simple_io()
510 label, iterations, retval, expected); in simple_io()
511 return retval; in simple_io()
610 int retval = 0; in perform_sglist() local
617 while (retval == 0 && iterations-- > 0) { in perform_sglist()
618 retval = usb_sg_init(req, udev, pipe, in perform_sglist()
624 if (retval) in perform_sglist()
630 retval = -ETIMEDOUT; in perform_sglist()
632 retval = req->status; in perform_sglist()
643 if (retval) in perform_sglist()
646 iterations, retval); in perform_sglist()
647 return retval; in perform_sglist()
673 int retval; in get_altsetting() local
675 retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), in get_altsetting()
679 switch (retval) { in get_altsetting()
683 retval = -ERANGE; in get_altsetting()
686 return retval; in get_altsetting()
830 int i, alt, retval; in ch9_postconfig() local
850 retval = set_altsetting(dev, alt); in ch9_postconfig()
851 if (retval) { in ch9_postconfig()
853 alt, retval); in ch9_postconfig()
854 return retval; in ch9_postconfig()
858 retval = get_altsetting(dev); in ch9_postconfig()
859 if (retval != alt) { in ch9_postconfig()
861 alt, retval); in ch9_postconfig()
862 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
875 retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), in ch9_postconfig()
879 if (retval != 1 || dev->buf[0] != expected) { in ch9_postconfig()
881 retval, dev->buf[0], expected); in ch9_postconfig()
882 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
887 retval = usb_get_descriptor(udev, USB_DT_DEVICE, 0, in ch9_postconfig()
889 if (retval != sizeof(udev->descriptor)) { in ch9_postconfig()
890 dev_err(&iface->dev, "dev descriptor --> %d\n", retval); in ch9_postconfig()
891 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
904 retval = usb_get_descriptor(udev, USB_DT_BOS, 0, dev->buf, in ch9_postconfig()
906 if (retval != sizeof(*udev->bos->desc)) { in ch9_postconfig()
907 dev_err(&iface->dev, "bos descriptor --> %d\n", retval); in ch9_postconfig()
908 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
922 retval = usb_get_descriptor(udev, USB_DT_BOS, 0, dev->buf, in ch9_postconfig()
924 if (retval != total) { in ch9_postconfig()
926 retval); in ch9_postconfig()
927 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
980 retval = usb_get_descriptor(udev, USB_DT_CONFIG, i, in ch9_postconfig()
982 if (!is_good_config(dev, retval)) { in ch9_postconfig()
985 i, retval); in ch9_postconfig()
986 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
999 retval = usb_get_descriptor(udev, in ch9_postconfig()
1002 if (retval == -EPIPE) { in ch9_postconfig()
1006 retval); in ch9_postconfig()
1007 return retval; in ch9_postconfig()
1010 } else if (retval != sizeof(struct usb_qualifier_descriptor)) { in ch9_postconfig()
1011 dev_err(&iface->dev, "dev qualifier --> %d\n", retval); in ch9_postconfig()
1012 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
1020 retval = usb_get_descriptor(udev, in ch9_postconfig()
1023 if (!is_good_config(dev, retval)) { in ch9_postconfig()
1026 retval); in ch9_postconfig()
1027 return (retval < 0) ? retval : -EDOM; in ch9_postconfig()
1035 retval = usb_get_std_status(udev, USB_RECIP_DEVICE, 0, dev->buf); in ch9_postconfig()
1036 if (retval) { in ch9_postconfig()
1037 dev_err(&iface->dev, "get dev status --> %d\n", retval); in ch9_postconfig()
1038 return retval; in ch9_postconfig()
1045 retval = usb_get_std_status(udev, USB_RECIP_INTERFACE, in ch9_postconfig()
1047 if (retval) { in ch9_postconfig()
1048 dev_err(&iface->dev, "get interface status --> %d\n", retval); in ch9_postconfig()
1049 return retval; in ch9_postconfig()
1439 int retval = 0; in unlink1() local
1459 retval = usb_submit_urb(urb, GFP_KERNEL); in unlink1()
1460 if (retval != 0) { in unlink1()
1461 dev_err(&dev->intf->dev, "submit fail %d\n", retval); in unlink1()
1462 return retval; in unlink1()
1471 retval = usb_unlink_urb(urb); in unlink1()
1473 if (retval == 0 && usb_pipein(urb->pipe)) in unlink1()
1474 retval = simple_check_buf(dev, urb); in unlink1()
1476 switch (retval) { in unlink1()
1493 "unlink fail %d\n", retval); in unlink1()
1494 return retval; in unlink1()
1503 retval = urb->status; in unlink1()
1507 return (retval == -ECONNRESET) ? 0 : retval - 1000; in unlink1()
1509 return (retval == -ENOENT || retval == -EPERM) ? in unlink1()
1510 0 : retval - 2000; in unlink1()
1515 int retval = 0; in unlink_simple() local
1518 retval = unlink1(dev, pipe, len, 1); in unlink_simple()
1519 if (!retval) in unlink_simple()
1520 retval = unlink1(dev, pipe, len, 0); in unlink_simple()
1521 return retval; in unlink_simple()
1562 int retval = -ENOMEM; in unlink_queued() local
1571 return retval; in unlink_queued()
1596 retval = usb_submit_urb(ctx.urbs[i], GFP_KERNEL); in unlink_queued()
1597 if (retval != 0) { in unlink_queued()
1599 i, retval); in unlink_queued()
1601 ctx.status = retval; in unlink_queued()
1616 retval = ctx.status; in unlink_queued()
1624 return retval; in unlink_queued()
1631 int retval; in verify_not_halted() local
1635 retval = usb_get_std_status(urb->dev, USB_RECIP_ENDPOINT, ep, &status); in verify_not_halted()
1636 if (retval < 0) { in verify_not_halted()
1638 ep, retval); in verify_not_halted()
1639 return retval; in verify_not_halted()
1645 retval = simple_io(tdev, urb, 1, 0, 0, __func__); in verify_not_halted()
1646 if (retval != 0) in verify_not_halted()
1653 int retval; in verify_halted() local
1657 retval = usb_get_std_status(urb->dev, USB_RECIP_ENDPOINT, ep, &status); in verify_halted()
1658 if (retval < 0) { in verify_halted()
1660 ep, retval); in verify_halted()
1661 return retval; in verify_halted()
1667 retval = simple_io(tdev, urb, 1, 0, -EPIPE, __func__); in verify_halted()
1668 if (retval != -EPIPE) in verify_halted()
1670 retval = simple_io(tdev, urb, 1, 0, -EPIPE, "verify_still_halted"); in verify_halted()
1671 if (retval != -EPIPE) in verify_halted()
1678 int retval; in test_halt() local
1681 retval = verify_not_halted(tdev, ep, urb); in test_halt()
1682 if (retval < 0) in test_halt()
1683 return retval; in test_halt()
1686 retval = usb_control_msg(urb->dev, usb_sndctrlpipe(urb->dev, 0), in test_halt()
1690 if (retval < 0) { in test_halt()
1691 ERROR(tdev, "ep %02x couldn't set halt, %d\n", ep, retval); in test_halt()
1692 return retval; in test_halt()
1694 retval = verify_halted(tdev, ep, urb); in test_halt()
1695 if (retval < 0) { in test_halt()
1704 return retval; in test_halt()
1708 retval = usb_clear_halt(urb->dev, urb->pipe); in test_halt()
1709 if (retval < 0) { in test_halt()
1710 ERROR(tdev, "ep %02x couldn't clear halt, %d\n", ep, retval); in test_halt()
1711 return retval; in test_halt()
1713 retval = verify_not_halted(tdev, ep, urb); in test_halt()
1714 if (retval < 0) in test_halt()
1715 return retval; in test_halt()
1724 int retval; in test_toggle_sync() local
1727 retval = usb_clear_halt(urb->dev, urb->pipe); in test_toggle_sync()
1728 if (retval < 0) { in test_toggle_sync()
1729 ERROR(tdev, "ep %02x couldn't clear halt, %d\n", ep, retval); in test_toggle_sync()
1730 return retval; in test_toggle_sync()
1734 retval = simple_io(tdev, urb, 1, 0, 0, __func__); in test_toggle_sync()
1735 if (retval != 0) in test_toggle_sync()
1739 retval = usb_clear_halt(urb->dev, urb->pipe); in test_toggle_sync()
1740 if (retval < 0) { in test_toggle_sync()
1741 ERROR(tdev, "ep %02x couldn't clear halt, %d\n", ep, retval); in test_toggle_sync()
1742 return retval; in test_toggle_sync()
1746 retval = simple_io(tdev, urb, 1, 0, 0, __func__); in test_toggle_sync()
1748 return retval; in test_toggle_sync()
1754 int retval = 0; in halt_simple() local
1768 retval = test_halt(dev, ep, urb); in halt_simple()
1769 if (retval < 0) in halt_simple()
1776 retval = test_halt(dev, ep, urb); in halt_simple()
1780 return retval; in halt_simple()
1786 int retval = 0; in toggle_sync_simple() local
1804 retval = test_toggle_sync(dev, ep, urb); in toggle_sync_simple()
1807 return retval; in toggle_sync_simple()
1824 int retval; in ctrl_out() local
1839 retval = 0; in ctrl_out()
1848 retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), in ctrl_out()
1851 if (retval != len) { in ctrl_out()
1853 if (retval >= 0) { in ctrl_out()
1855 retval, len); in ctrl_out()
1856 retval = -EBADMSG; in ctrl_out()
1862 retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), in ctrl_out()
1865 if (retval != len) { in ctrl_out()
1867 if (retval >= 0) { in ctrl_out()
1869 retval, len); in ctrl_out()
1870 retval = -EBADMSG; in ctrl_out()
1880 retval = -EBADMSG; in ctrl_out()
1884 if (retval < 0) { in ctrl_out()
1899 if (retval < 0) in ctrl_out()
1901 what, retval, i); in ctrl_out()
1904 return retval; in ctrl_out()
2166 int retval; in test_unaligned_bulk() local
2173 retval = simple_io(tdev, urb, iterations, 0, 0, label); in test_unaligned_bulk()
2175 return retval; in test_unaligned_bulk()
2188 int retval = -EOPNOTSUPP; in usbtest_do_ioctl() local
2207 retval = 0; in usbtest_do_ioctl()
2219 retval = -ENOMEM; in usbtest_do_ioctl()
2223 retval = simple_io(dev, urb, param->iterations, 0, 0, "test1"); in usbtest_do_ioctl()
2234 retval = -ENOMEM; in usbtest_do_ioctl()
2238 retval = simple_io(dev, urb, param->iterations, 0, 0, "test2"); in usbtest_do_ioctl()
2249 retval = -ENOMEM; in usbtest_do_ioctl()
2253 retval = simple_io(dev, urb, param->iterations, param->vary, in usbtest_do_ioctl()
2265 retval = -ENOMEM; in usbtest_do_ioctl()
2269 retval = simple_io(dev, urb, param->iterations, param->vary, in usbtest_do_ioctl()
2285 retval = -ENOMEM; in usbtest_do_ioctl()
2289 retval = perform_sglist(dev, param->iterations, dev->out_pipe, in usbtest_do_ioctl()
2304 retval = -ENOMEM; in usbtest_do_ioctl()
2308 retval = perform_sglist(dev, param->iterations, dev->in_pipe, in usbtest_do_ioctl()
2322 retval = -ENOMEM; in usbtest_do_ioctl()
2326 retval = perform_sglist(dev, param->iterations, dev->out_pipe, in usbtest_do_ioctl()
2340 retval = -ENOMEM; in usbtest_do_ioctl()
2344 retval = perform_sglist(dev, param->iterations, dev->in_pipe, in usbtest_do_ioctl()
2351 retval = 0; in usbtest_do_ioctl()
2355 for (i = param->iterations; retval == 0 && i--; /* NOP */) in usbtest_do_ioctl()
2356 retval = ch9_postconfig(dev); in usbtest_do_ioctl()
2357 if (retval) in usbtest_do_ioctl()
2364 retval = 0; in usbtest_do_ioctl()
2369 retval = test_ctrl_queue(dev, param); 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 = unlink_simple(dev, dev->in_pipe, in usbtest_do_ioctl()
2382 if (retval) in usbtest_do_ioctl()
2384 "iterations left %d\n", retval, i); in usbtest_do_ioctl()
2389 retval = 0; in usbtest_do_ioctl()
2392 for (i = param->iterations; retval == 0 && i--; /* NOP */) in usbtest_do_ioctl()
2393 retval = unlink_simple(dev, dev->out_pipe, in usbtest_do_ioctl()
2395 if (retval) in usbtest_do_ioctl()
2397 "iterations left %d\n", retval, i); in usbtest_do_ioctl()
2404 retval = 0; in usbtest_do_ioctl()
2407 for (i = param->iterations; retval == 0 && i--; /* NOP */) in usbtest_do_ioctl()
2408 retval = halt_simple(dev); in usbtest_do_ioctl()
2410 if (retval) in usbtest_do_ioctl()
2422 retval = ctrl_out(dev, param->iterations, in usbtest_do_ioctl()
2435 retval = test_queue(dev, param, in usbtest_do_ioctl()
2448 retval = test_queue(dev, param, in usbtest_do_ioctl()
2462 retval = test_unaligned_bulk( in usbtest_do_ioctl()
2475 retval = test_unaligned_bulk( in usbtest_do_ioctl()
2489 retval = test_unaligned_bulk( in usbtest_do_ioctl()
2502 retval = test_unaligned_bulk( in usbtest_do_ioctl()
2517 retval = ctrl_out(dev, param->iterations, in usbtest_do_ioctl()
2529 retval = test_queue(dev, param, in usbtest_do_ioctl()
2540 retval = test_queue(dev, param, in usbtest_do_ioctl()
2548 retval = 0; in usbtest_do_ioctl()
2552 for (i = param->iterations; retval == 0 && i > 0; --i) { in usbtest_do_ioctl()
2553 retval = unlink_queued(dev, dev->out_pipe, in usbtest_do_ioctl()
2555 if (retval) { in usbtest_do_ioctl()
2558 "iterations left %d\n", retval, i); in usbtest_do_ioctl()
2574 retval = -ENOMEM; in usbtest_do_ioctl()
2578 retval = simple_io(dev, urb, param->iterations, 0, 0, "test25"); in usbtest_do_ioctl()
2590 retval = -ENOMEM; in usbtest_do_ioctl()
2594 retval = simple_io(dev, urb, param->iterations, 0, 0, "test26"); in usbtest_do_ioctl()
2604 retval = test_queue(dev, param, in usbtest_do_ioctl()
2613 retval = test_queue(dev, param, in usbtest_do_ioctl()
2620 retval = 0; in usbtest_do_ioctl()
2623 for (i = param->iterations; retval == 0 && i > 0; --i) in usbtest_do_ioctl()
2624 retval = toggle_sync_simple(dev); in usbtest_do_ioctl()
2626 if (retval) in usbtest_do_ioctl()
2631 return retval; in usbtest_do_ioctl()
2668 int retval = -EOPNOTSUPP; in usbtest_ioctl() local
2685 retval = -ENODEV; in usbtest_ioctl()
2688 retval = set_altsetting(dev, dev->info->alt); in usbtest_ioctl()
2689 if (retval) { in usbtest_ioctl()
2692 dev->info->alt, retval); in usbtest_ioctl()
2711 retval = -EOPNOTSUPP; in usbtest_ioctl()
2717 retval = usbtest_do_ioctl(intf, param_32); in usbtest_ioctl()
2718 if (retval < 0) in usbtest_ioctl()
2742 return retval; in usbtest_ioctl()