提交 2708e888 编写于 作者: M Michael Krufky 提交者: Mauro Carvalho Chehab

V4L/DVB (8300): sms1xxx: simplify smsusb_init_device switch..case block

Signed-off-by: NMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 0c071f37
...@@ -281,7 +281,6 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id) ...@@ -281,7 +281,6 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
{ {
struct smsdevice_params_t params; struct smsdevice_params_t params;
struct smsusb_device_t *dev; struct smsusb_device_t *dev;
struct sms_board *board;
int i, rc; int i, rc;
/* create device object */ /* create device object */
...@@ -295,36 +294,21 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id) ...@@ -295,36 +294,21 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
usb_set_intfdata(intf, dev); usb_set_intfdata(intf, dev);
dev->udev = interface_to_usbdev(intf); dev->udev = interface_to_usbdev(intf);
board = sms_get_board(board_id); params.device_type = sms_get_board(board_id)->type;
switch (board->type) {
switch (params.device_type) {
case SMS_STELLAR: case SMS_STELLAR:
dev->buffer_size = USB1_BUFFER_SIZE; dev->buffer_size = USB1_BUFFER_SIZE;
params.setmode_handler = smsusb1_setmode; params.setmode_handler = smsusb1_setmode;
params.detectmode_handler = smsusb1_detectmode; params.detectmode_handler = smsusb1_detectmode;
params.device_type = SMS_STELLAR;
sms_info("stellar device found");
break; break;
default: default:
switch (board->type) { sms_err("Unspecified sms device type!");
case SMS_NOVA_A0: /* fall-thru */
params.device_type = SMS_NOVA_A0; case SMS_NOVA_A0:
sms_info("nova A0 found"); case SMS_NOVA_B0:
break; case SMS_VEGA:
case SMS_NOVA_B0:
params.device_type = SMS_NOVA_B0;
sms_info("nova B0 found");
break;
case SMS_VEGA:
params.device_type = SMS_VEGA;
sms_info("Vega found");
break;
default:
sms_err("Unspecified sms device type!");
}
dev->buffer_size = USB2_BUFFER_SIZE; dev->buffer_size = USB2_BUFFER_SIZE;
dev->response_alignment = dev->response_alignment =
dev->udev->ep_in[1]->desc.wMaxPacketSize - dev->udev->ep_in[1]->desc.wMaxPacketSize -
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册