[PATCH 04/26] media: dvb-usb: Add helper macros for using USB VID/PID
From: Mauro Carvalho Chehab
Date: Mon Mar 28 2022 - 16:48:12 EST
In order to use designated initializers and to avoid avoid big lines
at the USB ID tables, define some helper macros.
Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
---
To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover.
See [PATCH 00/26] at: https://lore.kernel.org/all/cover.1648499509.git.mchehab@xxxxxxxxxx/
include/media/dvb-usb-ids.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/media/dvb-usb-ids.h b/include/media/dvb-usb-ids.h
index 9577cae8c73b..5ae55c20912e 100644
--- a/include/media/dvb-usb-ids.h
+++ b/include/media/dvb-usb-ids.h
@@ -10,6 +10,14 @@
#ifndef _DVB_USB_IDS_H_
#define _DVB_USB_IDS_H_
+#include <linux/usb.h>
+
+#define DVB_USB_DEV(pid, vid) \
+ [vid] = { USB_DEVICE(USB_VID_ ## pid, USB_PID_ ## vid) }
+
+#define DVB_USB_DEV_VER(pid, vid, lo, hi) \
+ [vid] = { USB_DEVICE_VER(USB_VID_ ## pid, USB_PID_ ## vid, lo, hi) }
+
/* Vendor IDs */
#define USB_VID_774 0x7a69
--
2.35.1