diff options
author | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-03-28 22:41:19 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-04-18 07:36:43 +0200 |
commit | 5441df36e1c75efa096d23c9a86119cf6ca8328c (patch) | |
tree | aec90e18a1f01632041589425fa9dc37cc7e8cc9 /drivers | |
parent | 41c7eb3348fda1cdb31f1729690d83c3ca64d8fc (diff) |
media: dvb-usb: az6027: 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/65b9775c39dcd21e5cb75a86e1e7b99b7d6eefcd.1648499509.git.mchehab@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/usb/dvb-usb/az6027.c | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/drivers/media/usb/dvb-usb/az6027.c b/drivers/media/usb/dvb-usb/az6027.c index 86788771175b..cf15988dfb51 100644 --- a/drivers/media/usb/dvb-usb/az6027.c +++ b/drivers/media/usb/dvb-usb/az6027.c @@ -1080,16 +1080,27 @@ static int az6027_identify_state(struct usb_device *udev, } +enum { + AZUREWAVE_AZ6027, + TERRATEC_DVBS2CI_V1, + TERRATEC_DVBS2CI_V2, + TECHNISAT_USB2_HDCI_V1, + TECHNISAT_USB2_HDCI_V2, + ELGATO_EYETV_SAT, + ELGATO_EYETV_SAT_V2, + ELGATO_EYETV_SAT_V3, +}; + static struct usb_device_id az6027_usb_table[] = { - { USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_AZUREWAVE_AZ6027) }, - { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_DVBS2CI_V1) }, - { USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_DVBS2CI_V2) }, - { USB_DEVICE(USB_VID_TECHNISAT, USB_PID_TECHNISAT_USB2_HDCI_V1) }, - { USB_DEVICE(USB_VID_TECHNISAT, USB_PID_TECHNISAT_USB2_HDCI_V2) }, - { USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_SAT) }, - { USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_SAT_V2) }, - { USB_DEVICE(USB_VID_ELGATO, USB_PID_ELGATO_EYETV_SAT_V3) }, - { }, + DVB_USB_DEV(AZUREWAVE, AZUREWAVE_AZ6027), + DVB_USB_DEV(TERRATEC, TERRATEC_DVBS2CI_V1), + DVB_USB_DEV(TERRATEC, TERRATEC_DVBS2CI_V2), + DVB_USB_DEV(TECHNISAT, TECHNISAT_USB2_HDCI_V1), + DVB_USB_DEV(TECHNISAT, TECHNISAT_USB2_HDCI_V2), + DVB_USB_DEV(ELGATO, ELGATO_EYETV_SAT), + DVB_USB_DEV(ELGATO, ELGATO_EYETV_SAT_V2), + DVB_USB_DEV(ELGATO, ELGATO_EYETV_SAT_V3), + { } }; MODULE_DEVICE_TABLE(usb, az6027_usb_table); @@ -1141,35 +1152,35 @@ static struct dvb_usb_device_properties az6027_properties = { .devices = { { .name = "AZUREWAVE DVB-S/S2 USB2.0 (AZ6027)", - .cold_ids = { &az6027_usb_table[0], NULL }, + .cold_ids = { &az6027_usb_table[AZUREWAVE_AZ6027], NULL }, .warm_ids = { NULL }, }, { .name = "TERRATEC S7", - .cold_ids = { &az6027_usb_table[1], NULL }, + .cold_ids = { &az6027_usb_table[TERRATEC_DVBS2CI_V1], NULL }, .warm_ids = { NULL }, }, { .name = "TERRATEC S7 MKII", - .cold_ids = { &az6027_usb_table[2], NULL }, + .cold_ids = { &az6027_usb_table[TERRATEC_DVBS2CI_V2], NULL }, .warm_ids = { NULL }, }, { .name = "Technisat SkyStar USB 2 HD CI", - .cold_ids = { &az6027_usb_table[3], NULL }, + .cold_ids = { &az6027_usb_table[TECHNISAT_USB2_HDCI_V1], NULL }, .warm_ids = { NULL }, }, { .name = "Technisat SkyStar USB 2 HD CI", - .cold_ids = { &az6027_usb_table[4], NULL }, + .cold_ids = { &az6027_usb_table[TECHNISAT_USB2_HDCI_V2], NULL }, .warm_ids = { NULL }, }, { .name = "Elgato EyeTV Sat", - .cold_ids = { &az6027_usb_table[5], NULL }, + .cold_ids = { &az6027_usb_table[ELGATO_EYETV_SAT], NULL }, .warm_ids = { NULL }, }, { .name = "Elgato EyeTV Sat", - .cold_ids = { &az6027_usb_table[6], NULL }, + .cold_ids = { &az6027_usb_table[ELGATO_EYETV_SAT_V2], NULL }, .warm_ids = { NULL }, }, { .name = "Elgato EyeTV Sat", - .cold_ids = { &az6027_usb_table[7], NULL }, + .cold_ids = { &az6027_usb_table[ELGATO_EYETV_SAT_V3], NULL }, .warm_ids = { NULL }, }, { NULL }, |