From b57d2db1a3b4146f8b7f967da1d60f8f9608e689 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Mon, 11 May 2015 18:20:06 +0200 Subject: toradex: common: use define for product number offset The USB product ID's for the Colibri/Apalis family of Toradex can be calculated by using the Toradex product ID (as provided by the config block) plus a fixed offset of 0x4000. --- board/toradex/common/common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/board/toradex/common/common.c b/board/toradex/common/common.c index ac1b73430b..8f89a9fb74 100644 --- a/board/toradex/common/common.c +++ b/board/toradex/common/common.c @@ -9,6 +9,8 @@ #include #include +#define TORADEX_USB_PRODUCT_NUM_OFFSET 0x4000 + static char trdx_serial_str[9]; static char trdx_board_rev_str[6]; @@ -134,7 +136,7 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) unsigned short usb_pid = 0xffff; #ifdef CONFIG_TRDX_CONFIGBLOCK - usb_pid = 0x4000 + trdx_hw_tag.prodid; + usb_pid = TORADEX_USB_PRODUCT_NUM_OFFSET + trdx_hw_tag.prodid; #endif put_unaligned(usb_pid, &dev->idProduct); -- cgit v1.2.3