diff mbox series

[04/26] media: dvb-usb: Add helper macros for using USB VID/PID

Message ID f82e376dea2e9b922f51a03d1e7730b03e49cc7d.1648499509.git.mchehab@kernel.org (mailing list archive)
State New, archived
Headers show
Series dvb-usb: use designated initializers | expand

Commit Message

Mauro Carvalho Chehab March 28, 2022, 8:41 p.m. UTC
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@kernel.org>
---

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@kernel.org/

 include/media/dvb-usb-ids.h | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

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