Commit 86fd1a41 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: dvb-usb: dtt200u: use an enum for the device number

The device number is currently a value that needs to be the same
on two separate tables, but the code doesn't actually enforce it,
leading to errors as boards get added or removed.

Fix it by using an enum.

Link: https://lore.kernel.org/linux-media/9fa3d1add4c58e1320dcc18578fda2d0106becda.1648499509.git.mchehab@kernel.orgSigned-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent b18869ba
...@@ -158,19 +158,33 @@ static int dtt200u_usb_probe(struct usb_interface *intf, ...@@ -158,19 +158,33 @@ static int dtt200u_usb_probe(struct usb_interface *intf,
return -ENODEV; return -ENODEV;
} }
static struct usb_device_id dtt200u_usb_table [] = { enum {
{ USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_DTT200U_COLD) }, WIDEVIEW_DTT200U_COLD,
{ USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_DTT200U_WARM) }, WIDEVIEW_DTT200U_WARM,
{ USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_COLD) }, WIDEVIEW_WT220U_COLD,
{ USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_WARM) }, WIDEVIEW_WT220U_WARM,
{ USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_ZL0353_COLD) }, WIDEVIEW_WT220U_ZL0353_COLD,
{ USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_ZL0353_WARM) }, WIDEVIEW_WT220U_ZL0353_WARM,
{ USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_FC_COLD) }, WIDEVIEW_WT220U_FC_COLD,
{ USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_FC_WARM) }, WIDEVIEW_WT220U_FC_WARM,
{ USB_DEVICE(USB_VID_WIDEVIEW, USB_PID_WT220U_ZAP250_COLD) }, WIDEVIEW_WT220U_ZAP250_COLD,
{ USB_DEVICE(USB_VID_MIGLIA, USB_PID_WT220U_ZAP250_COLD) }, MIGLIA_WT220U_ZAP250_COLD,
{ 0 },
}; };
static struct usb_device_id dtt200u_usb_table[] = {
DVB_USB_DEV(WIDEVIEW, WIDEVIEW_DTT200U_COLD),
DVB_USB_DEV(WIDEVIEW, WIDEVIEW_DTT200U_WARM),
DVB_USB_DEV(WIDEVIEW, WIDEVIEW_WT220U_COLD),
DVB_USB_DEV(WIDEVIEW, WIDEVIEW_WT220U_WARM),
DVB_USB_DEV(WIDEVIEW, WIDEVIEW_WT220U_ZL0353_COLD),
DVB_USB_DEV(WIDEVIEW, WIDEVIEW_WT220U_ZL0353_WARM),
DVB_USB_DEV(WIDEVIEW, WIDEVIEW_WT220U_FC_COLD),
DVB_USB_DEV(WIDEVIEW, WIDEVIEW_WT220U_FC_WARM),
DVB_USB_DEV(WIDEVIEW, WIDEVIEW_WT220U_ZAP250_COLD),
DVB_USB_DEV(MIGLIA, MIGLIA_WT220U_ZAP250_COLD),
{ }
};
MODULE_DEVICE_TABLE(usb, dtt200u_usb_table); MODULE_DEVICE_TABLE(usb, dtt200u_usb_table);
static struct dvb_usb_device_properties dtt200u_properties = { static struct dvb_usb_device_properties dtt200u_properties = {
...@@ -218,8 +232,8 @@ static struct dvb_usb_device_properties dtt200u_properties = { ...@@ -218,8 +232,8 @@ static struct dvb_usb_device_properties dtt200u_properties = {
.num_device_descs = 1, .num_device_descs = 1,
.devices = { .devices = {
{ .name = "WideView/Yuan/Yakumo/Hama/Typhoon DVB-T USB2.0 (WT-200U)", { .name = "WideView/Yuan/Yakumo/Hama/Typhoon DVB-T USB2.0 (WT-200U)",
.cold_ids = { &dtt200u_usb_table[0], NULL }, .cold_ids = { &dtt200u_usb_table[WIDEVIEW_DTT200U_COLD], NULL },
.warm_ids = { &dtt200u_usb_table[1], NULL }, .warm_ids = { &dtt200u_usb_table[WIDEVIEW_DTT200U_WARM], NULL },
}, },
{ NULL }, { NULL },
} }
...@@ -270,8 +284,8 @@ static struct dvb_usb_device_properties wt220u_properties = { ...@@ -270,8 +284,8 @@ static struct dvb_usb_device_properties wt220u_properties = {
.num_device_descs = 1, .num_device_descs = 1,
.devices = { .devices = {
{ .name = "WideView WT-220U PenType Receiver (Typhoon/Freecom)", { .name = "WideView WT-220U PenType Receiver (Typhoon/Freecom)",
.cold_ids = { &dtt200u_usb_table[2], &dtt200u_usb_table[8], NULL }, .cold_ids = { &dtt200u_usb_table[WIDEVIEW_WT220U_COLD], &dtt200u_usb_table[WIDEVIEW_WT220U_ZAP250_COLD], NULL },
.warm_ids = { &dtt200u_usb_table[3], NULL }, .warm_ids = { &dtt200u_usb_table[WIDEVIEW_WT220U_WARM], NULL },
}, },
{ NULL }, { NULL },
} }
...@@ -322,8 +336,8 @@ static struct dvb_usb_device_properties wt220u_fc_properties = { ...@@ -322,8 +336,8 @@ static struct dvb_usb_device_properties wt220u_fc_properties = {
.num_device_descs = 1, .num_device_descs = 1,
.devices = { .devices = {
{ .name = "WideView WT-220U PenType Receiver (Typhoon/Freecom)", { .name = "WideView WT-220U PenType Receiver (Typhoon/Freecom)",
.cold_ids = { &dtt200u_usb_table[6], NULL }, .cold_ids = { &dtt200u_usb_table[WIDEVIEW_WT220U_FC_COLD], NULL },
.warm_ids = { &dtt200u_usb_table[7], NULL }, .warm_ids = { &dtt200u_usb_table[WIDEVIEW_WT220U_FC_WARM], NULL },
}, },
{ NULL }, { NULL },
} }
...@@ -374,8 +388,8 @@ static struct dvb_usb_device_properties wt220u_zl0353_properties = { ...@@ -374,8 +388,8 @@ static struct dvb_usb_device_properties wt220u_zl0353_properties = {
.num_device_descs = 1, .num_device_descs = 1,
.devices = { .devices = {
{ .name = "WideView WT-220U PenType Receiver (based on ZL353)", { .name = "WideView WT-220U PenType Receiver (based on ZL353)",
.cold_ids = { &dtt200u_usb_table[4], NULL }, .cold_ids = { &dtt200u_usb_table[WIDEVIEW_WT220U_ZL0353_COLD], NULL },
.warm_ids = { &dtt200u_usb_table[5], NULL }, .warm_ids = { &dtt200u_usb_table[WIDEVIEW_WT220U_ZL0353_WARM], NULL },
}, },
{ NULL }, { NULL },
} }
...@@ -393,7 +407,7 @@ static struct dvb_usb_device_properties wt220u_miglia_properties = { ...@@ -393,7 +407,7 @@ static struct dvb_usb_device_properties wt220u_miglia_properties = {
.num_device_descs = 1, .num_device_descs = 1,
.devices = { .devices = {
{ .name = "WideView WT-220U PenType Receiver (Miglia)", { .name = "WideView WT-220U PenType Receiver (Miglia)",
.cold_ids = { &dtt200u_usb_table[9], NULL }, .cold_ids = { &dtt200u_usb_table[MIGLIA_WT220U_ZAP250_COLD], NULL },
/* This device turns into WT220U_ZL0353_WARM when fw /* This device turns into WT220U_ZL0353_WARM when fw
has been uploaded */ has been uploaded */
.warm_ids = { NULL }, .warm_ids = { NULL },
......
...@@ -194,8 +194,6 @@ ...@@ -194,8 +194,6 @@
#define USB_PID_DNTV_TINYUSB2_WARM 0x3224 #define USB_PID_DNTV_TINYUSB2_WARM 0x3224
#define USB_PID_DPOSH_M9206_COLD 0x9206 #define USB_PID_DPOSH_M9206_COLD 0x9206
#define USB_PID_DPOSH_M9206_WARM 0xa090 #define USB_PID_DPOSH_M9206_WARM 0xa090
#define USB_PID_DTT200U_COLD 0x0201
#define USB_PID_DTT200U_WARM 0x0301
#define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_COLD 0x5000 #define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_COLD 0x5000
#define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_WARM 0x5001 #define USB_PID_DVB_T_USB_STICK_HIGH_SPEED_WARM 0x5001
#define USB_PID_DVICO_BLUEBIRD_DUAL_1_COLD 0xdb50 #define USB_PID_DVICO_BLUEBIRD_DUAL_1_COLD 0xdb50
...@@ -290,6 +288,7 @@ ...@@ -290,6 +288,7 @@
#define USB_PID_LITEON_DVB_T_COLD 0xf000 #define USB_PID_LITEON_DVB_T_COLD 0xf000
#define USB_PID_LITEON_DVB_T_WARM 0xf001 #define USB_PID_LITEON_DVB_T_WARM 0xf001
#define USB_PID_MEDION_MD95700 0x0932 #define USB_PID_MEDION_MD95700 0x0932
#define USB_PID_MIGLIA_WT220U_ZAP250_COLD 0x0220
#define USB_PID_MSI_DIGIVOX_DUO 0x8801 #define USB_PID_MSI_DIGIVOX_DUO 0x8801
#define USB_PID_MSI_DIGI_VOX_MINI_II 0x1513 #define USB_PID_MSI_DIGI_VOX_MINI_II 0x1513
#define USB_PID_MSI_DIGI_VOX_MINI_III 0x8807 #define USB_PID_MSI_DIGI_VOX_MINI_III 0x8807
...@@ -430,6 +429,15 @@ ...@@ -430,6 +429,15 @@
#define USB_PID_UNIWILL_STK7700P 0x6003 #define USB_PID_UNIWILL_STK7700P 0x6003
#define USB_PID_UNK_HYPER_PALTEK_COLD 0x005e #define USB_PID_UNK_HYPER_PALTEK_COLD 0x005e
#define USB_PID_UNK_HYPER_PALTEK_WARM 0x005f #define USB_PID_UNK_HYPER_PALTEK_WARM 0x005f
#define USB_PID_WIDEVIEW_DTT200U_COLD 0x0201
#define USB_PID_WIDEVIEW_DTT200U_WARM 0x0301
#define USB_PID_WIDEVIEW_WT220U_COLD 0x0222
#define USB_PID_WIDEVIEW_WT220U_FC_COLD 0x0225
#define USB_PID_WIDEVIEW_WT220U_FC_WARM 0x0226
#define USB_PID_WIDEVIEW_WT220U_WARM 0x0221
#define USB_PID_WIDEVIEW_WT220U_ZAP250_COLD 0x0220
#define USB_PID_WIDEVIEW_WT220U_ZL0353_COLD 0x022a
#define USB_PID_WIDEVIEW_WT220U_ZL0353_WARM 0x022b
#define USB_PID_WINFAST_DTV2000DS 0x6a04 #define USB_PID_WINFAST_DTV2000DS 0x6a04
#define USB_PID_WINFAST_DTV2000DS_PLUS 0x6f12 #define USB_PID_WINFAST_DTV2000DS_PLUS 0x6f12
#define USB_PID_WINFAST_DTV_DONGLE_COLD 0x6025 #define USB_PID_WINFAST_DTV_DONGLE_COLD 0x6025
...@@ -443,13 +451,6 @@ ...@@ -443,13 +451,6 @@
#define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301 #define USB_PID_WINTV_NOVA_T_USB2_WARM 0x9301
#define USB_PID_WINTV_SOLOHD 0x0264 #define USB_PID_WINTV_SOLOHD 0x0264
#define USB_PID_WINTV_SOLOHD_2 0x8268 #define USB_PID_WINTV_SOLOHD_2 0x8268
#define USB_PID_WT220U_COLD 0x0222
#define USB_PID_WT220U_FC_COLD 0x0225
#define USB_PID_WT220U_FC_WARM 0x0226
#define USB_PID_WT220U_WARM 0x0221
#define USB_PID_WT220U_ZAP250_COLD 0x0220
#define USB_PID_WT220U_ZL0353_COLD 0x022a
#define USB_PID_WT220U_ZL0353_WARM 0x022b
#define USB_PID_XBOX_ONE_TUNER 0x02d5 #define USB_PID_XBOX_ONE_TUNER 0x02d5
#define USB_PID_XTENSIONS_XD_380 0x0381 #define USB_PID_XTENSIONS_XD_380 0x0381
#define USB_PID_YUAN_EC372S 0x1edc #define USB_PID_YUAN_EC372S 0x1edc
......
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