Commit c58701b2 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

V4L/DVB (9678): af9015: Cleanup switch for usb ID

It is much more readable to swap the byteorder in the switch rather
than in each case statement.
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 05583625
...@@ -745,8 +745,8 @@ static int af9015_read_config(struct usb_device *udev) ...@@ -745,8 +745,8 @@ static int af9015_read_config(struct usb_device *udev)
break; break;
} }
} else { } else {
switch (udev->descriptor.idVendor) { switch (le16_to_cpu(udev->descriptor.idVendor)) {
case cpu_to_le16(USB_VID_LEADTEK): case USB_VID_LEADTEK:
af9015_properties[i].rc_key_map = af9015_properties[i].rc_key_map =
af9015_rc_keys_leadtek; af9015_rc_keys_leadtek;
af9015_properties[i].rc_key_map_size = af9015_properties[i].rc_key_map_size =
...@@ -756,7 +756,7 @@ static int af9015_read_config(struct usb_device *udev) ...@@ -756,7 +756,7 @@ static int af9015_read_config(struct usb_device *udev)
af9015_config.ir_table_size = af9015_config.ir_table_size =
ARRAY_SIZE(af9015_ir_table_leadtek); ARRAY_SIZE(af9015_ir_table_leadtek);
break; break;
case cpu_to_le16(USB_VID_VISIONPLUS): case USB_VID_VISIONPLUS:
if (udev->descriptor.idProduct == if (udev->descriptor.idProduct ==
cpu_to_le16(USB_PID_AZUREWAVE_AD_TU700)) { cpu_to_le16(USB_PID_AZUREWAVE_AD_TU700)) {
af9015_properties[i].rc_key_map = af9015_properties[i].rc_key_map =
...@@ -769,7 +769,7 @@ static int af9015_read_config(struct usb_device *udev) ...@@ -769,7 +769,7 @@ static int af9015_read_config(struct usb_device *udev)
ARRAY_SIZE(af9015_ir_table_twinhan); ARRAY_SIZE(af9015_ir_table_twinhan);
} }
break; break;
case cpu_to_le16(USB_VID_KWORLD_2): case USB_VID_KWORLD_2:
/* TODO: use correct rc keys */ /* TODO: use correct rc keys */
af9015_properties[i].rc_key_map = af9015_properties[i].rc_key_map =
af9015_rc_keys_twinhan; af9015_rc_keys_twinhan;
...@@ -782,7 +782,7 @@ static int af9015_read_config(struct usb_device *udev) ...@@ -782,7 +782,7 @@ static int af9015_read_config(struct usb_device *udev)
/* Check USB manufacturer and product strings and try /* Check USB manufacturer and product strings and try
to determine correct remote in case of chip vendor to determine correct remote in case of chip vendor
reference IDs are used. */ reference IDs are used. */
case cpu_to_le16(USB_VID_AFATECH): case USB_VID_AFATECH:
memset(manufacturer, 0, sizeof(manufacturer)); memset(manufacturer, 0, sizeof(manufacturer));
usb_string(udev, udev->descriptor.iManufacturer, usb_string(udev, udev->descriptor.iManufacturer,
manufacturer, sizeof(manufacturer)); manufacturer, sizeof(manufacturer));
...@@ -810,7 +810,7 @@ static int af9015_read_config(struct usb_device *udev) ...@@ -810,7 +810,7 @@ static int af9015_read_config(struct usb_device *udev)
ARRAY_SIZE(af9015_ir_table_msi); ARRAY_SIZE(af9015_ir_table_msi);
} }
break; break;
case cpu_to_le16(USB_VID_AVERMEDIA): case USB_VID_AVERMEDIA:
af9015_properties[i].rc_key_map = af9015_properties[i].rc_key_map =
af9015_rc_keys_avermedia; af9015_rc_keys_avermedia;
af9015_properties[i].rc_key_map_size = af9015_properties[i].rc_key_map_size =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment