flexcop-usb.c (67102bd31b4e31abb0abbc390381212a2d65db72) flexcop-usb.c (3de50478b5cc2e0c2479a5f2b967f331f7597d23)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III
4 * flexcop-usb.c - covers the USB part
5 * see flexcop.c for copyright information
6 */
7#define FC_LOG_PREFIX "flexcop_usb"
8#include "flexcop-usb.h"

--- 487 unchanged lines hidden (view full) ---

496
497urb_error:
498 flexcop_usb_transfer_exit(fc_usb);
499 return ret;
500}
501
502static int flexcop_usb_init(struct flexcop_usb *fc_usb)
503{
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III
4 * flexcop-usb.c - covers the USB part
5 * see flexcop.c for copyright information
6 */
7#define FC_LOG_PREFIX "flexcop_usb"
8#include "flexcop-usb.h"

--- 487 unchanged lines hidden (view full) ---

496
497urb_error:
498 flexcop_usb_transfer_exit(fc_usb);
499 return ret;
500}
501
502static int flexcop_usb_init(struct flexcop_usb *fc_usb)
503{
504 /* use the alternate setting with the larges buffer */
505 int ret = usb_set_interface(fc_usb->udev, 0, 1);
504 struct usb_host_interface *alt;
505 int ret;
506
506
507 /* use the alternate setting with the largest buffer */
508 ret = usb_set_interface(fc_usb->udev, 0, 1);
507 if (ret) {
508 err("set interface failed.");
509 return ret;
510 }
511
509 if (ret) {
510 err("set interface failed.");
511 return ret;
512 }
513
512 if (fc_usb->uintf->cur_altsetting->desc.bNumEndpoints < 1)
514 alt = fc_usb->uintf->cur_altsetting;
515
516 if (alt->desc.bNumEndpoints < 1)
513 return -ENODEV;
517 return -ENODEV;
514 if (!usb_endpoint_is_isoc_in(&fc_usb->uintf->cur_altsetting->endpoint[0].desc))
518 if (!usb_endpoint_is_isoc_in(&alt->endpoint[0].desc))
515 return -ENODEV;
516
517 switch (fc_usb->udev->speed) {
518 case USB_SPEED_LOW:
519 err("cannot handle USB speed because it is too slow.");
520 return -ENODEV;
521 break;
522 case USB_SPEED_FULL:

--- 105 unchanged lines hidden ---
519 return -ENODEV;
520
521 switch (fc_usb->udev->speed) {
522 case USB_SPEED_LOW:
523 err("cannot handle USB speed because it is too slow.");
524 return -ENODEV;
525 break;
526 case USB_SPEED_FULL:

--- 105 unchanged lines hidden ---