summaryrefslogtreecommitdiff
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@kernel.org>2022-03-28 22:41:28 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-04-18 07:36:44 +0200
commitcb794c2b7ae5b769fd46a3cce9508f7e04bf172b (patch)
treee158fba2d60e55da5b88a8799bfd06853f201e90 /drivers/media/usb
parent3473fd1711527c24b3d37d6b13cfd341e2d5a3c7 (diff)
media: dvb-usb: nova-t-usb2: 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/58f1a356b7b75bbefef3aa07cd99896c446df32f.1648499509.git.mchehab@kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/dvb-usb/nova-t-usb2.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/media/usb/dvb-usb/nova-t-usb2.c b/drivers/media/usb/dvb-usb/nova-t-usb2.c
index 9c0eb0d40822..4782d0780913 100644
--- a/drivers/media/usb/dvb-usb/nova-t-usb2.c
+++ b/drivers/media/usb/dvb-usb/nova-t-usb2.c
@@ -160,11 +160,17 @@ static int nova_t_probe(struct usb_interface *intf,
}
/* do not change the order of the ID table */
-static struct usb_device_id nova_t_table [] = {
-/* 00 */ { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_WINTV_NOVA_T_USB2_COLD) },
-/* 01 */ { USB_DEVICE(USB_VID_HAUPPAUGE, USB_PID_WINTV_NOVA_T_USB2_WARM) },
- { } /* Terminating entry */
+enum {
+ HAUPPAUGE_WINTV_NOVA_T_USB2_COLD,
+ HAUPPAUGE_WINTV_NOVA_T_USB2_WARM,
};
+
+static struct usb_device_id nova_t_table[] = {
+ DVB_USB_DEV(HAUPPAUGE, HAUPPAUGE_WINTV_NOVA_T_USB2_COLD),
+ DVB_USB_DEV(HAUPPAUGE, HAUPPAUGE_WINTV_NOVA_T_USB2_WARM),
+ { }
+};
+
MODULE_DEVICE_TABLE(usb, nova_t_table);
static struct dvb_usb_device_properties nova_t_properties = {
@@ -221,8 +227,8 @@ static struct dvb_usb_device_properties nova_t_properties = {
.num_device_descs = 1,
.devices = {
{ "Hauppauge WinTV-NOVA-T usb2",
- { &nova_t_table[0], NULL },
- { &nova_t_table[1], NULL },
+ { &nova_t_table[HAUPPAUGE_WINTV_NOVA_T_USB2_COLD], NULL },
+ { &nova_t_table[HAUPPAUGE_WINTV_NOVA_T_USB2_WARM], NULL },
},
{ NULL },
}