Commit 5441df36 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

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.orgSigned-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 41c7eb33
......@@ -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 },
......
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