Commit 710801c7 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: dvb-usb: pctv452e: 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/283a8c6bdf9778f832b4f6acc104c06688281668.1648499509.git.mchehab@kernel.org


Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 22127ac8
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -951,13 +951,19 @@ static int pctv452e_tuner_attach(struct dvb_usb_adapter *a)
	return 0;
}

enum {
	PINNACLE_PCTV_452E,
	TECHNOTREND_CONNECT_S2_3600,
	TECHNOTREND_CONNECT_S2_3650_CI,
};

static struct usb_device_id pctv452e_usb_table[] = {
	{USB_DEVICE(USB_VID_PINNACLE, USB_PID_PCTV_452E)},
	{USB_DEVICE(USB_VID_TECHNOTREND, USB_PID_TECHNOTREND_CONNECT_S2_3600)},
	{USB_DEVICE(USB_VID_TECHNOTREND,
				USB_PID_TECHNOTREND_CONNECT_S2_3650_CI)},
	DVB_USB_DEV(PINNACLE, PINNACLE_PCTV_452E),
	DVB_USB_DEV(TECHNOTREND, TECHNOTREND_CONNECT_S2_3600),
	DVB_USB_DEV(TECHNOTREND, TECHNOTREND_CONNECT_S2_3650_CI),
	{ }
};

MODULE_DEVICE_TABLE(usb, pctv452e_usb_table);

static struct dvb_usb_device_properties pctv452e_properties = {
@@ -1006,7 +1012,7 @@ static struct dvb_usb_device_properties pctv452e_properties = {
	.devices = {
		{ .name = "PCTV HDTV USB",
		  .cold_ids = { NULL, NULL }, /* this is a warm only device */
		  .warm_ids = { &pctv452e_usb_table[0], NULL }
		  .warm_ids = { &pctv452e_usb_table[PINNACLE_PCTV_452E], NULL }
		},
		{ NULL },
	}
@@ -1060,11 +1066,11 @@ static struct dvb_usb_device_properties tt_connect_s2_3600_properties = {
	.devices = {
		{ .name = "Technotrend TT Connect S2-3600",
		  .cold_ids = { NULL, NULL }, /* this is a warm only device */
		  .warm_ids = { &pctv452e_usb_table[1], NULL }
		  .warm_ids = { &pctv452e_usb_table[TECHNOTREND_CONNECT_S2_3600], NULL }
		},
		{ .name = "Technotrend TT Connect S2-3650-CI",
		  .cold_ids = { NULL, NULL },
		  .warm_ids = { &pctv452e_usb_table[2], NULL }
		  .warm_ids = { &pctv452e_usb_table[TECHNOTREND_CONNECT_S2_3650_CI], NULL }
		},
		{ NULL },
	}
+1 −1
Original line number Diff line number Diff line
@@ -314,7 +314,6 @@
#define USB_PID_PCTV_200E				0x020e
#define USB_PID_PCTV_400E				0x020f
#define USB_PID_PCTV_450E				0x0222
#define USB_PID_PCTV_452E				0x021f
#define USB_PID_PCTV_78E				0x025a
#define USB_PID_PCTV_79E				0x0262
#define USB_PID_PINNACLE_EXPRESSCARD_320CX		0x022e
@@ -330,6 +329,7 @@
#define USB_PID_PINNACLE_PCTV74E			0x0246
#define USB_PID_PINNACLE_PCTV801E			0x023a
#define USB_PID_PINNACLE_PCTV801E_SE			0x023b
#define USB_PID_PINNACLE_PCTV_452E			0x021f
#define USB_PID_PINNACLE_PCTV_DUAL_DIVERSITY_DVB_T	0x0229
#define USB_PID_PINNACLE_PCTV_DVB_T_FLASH		0x0228
#define USB_PID_PIXELVIEW_SBTVD 			0x5010