Commit 55319eeb authored by Hayes Wang's avatar Hayes Wang Committed by David S. Miller

r8152: redefine REALTEK_USB_DEVICE macro

Redefine REALTEK_USB_DEVICE macro with USB_DEVICE_INTERFACE_CLASS and
USB_DEVICE_AND_INTERFACE_INFO to simply the code.

Although checkpatch.pl shows the following error, it is more readable.

	ERROR: Macros with complex values should be enclosed in parentheses
Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e7865ea5
...@@ -9579,49 +9579,41 @@ static void rtl8152_disconnect(struct usb_interface *intf) ...@@ -9579,49 +9579,41 @@ static void rtl8152_disconnect(struct usb_interface *intf)
} }
} }
#define REALTEK_USB_DEVICE(vend, prod) \ #define REALTEK_USB_DEVICE(vend, prod) { \
.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC), \
USB_DEVICE_ID_MATCH_INT_CLASS, \
.idVendor = (vend), \
.idProduct = (prod), \
.bInterfaceClass = USB_CLASS_VENDOR_SPEC \
}, \ }, \
{ \ { \
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO | \ USB_DEVICE_AND_INTERFACE_INFO(vend, prod, USB_CLASS_COMM, \
USB_DEVICE_ID_MATCH_DEVICE, \ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), \
.idVendor = (vend), \ }
.idProduct = (prod), \
.bInterfaceClass = USB_CLASS_COMM, \
.bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \
.bInterfaceProtocol = USB_CDC_PROTO_NONE
/* table of devices that work with this driver */ /* table of devices that work with this driver */
static const struct usb_device_id rtl8152_table[] = { static const struct usb_device_id rtl8152_table[] = {
/* Realtek */ /* Realtek */
{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8050)}, REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8050),
{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8053)}, REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8053),
{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152)}, REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152),
{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)}, REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153),
{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8155)}, REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8155),
{REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8156)}, REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8156),
/* Microsoft */ /* Microsoft */
{REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab)}, REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab),
{REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6)}, REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6),
{REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927)}, REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927),
{REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)}, REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101),
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f)}, REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f),
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062)}, REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062),
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3069)}, REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3069),
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3082)}, REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3082),
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205)}, REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205),
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c)}, REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c),
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7214)}, REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7214),
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x721e)}, REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x721e),
{REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0xa387)}, REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0xa387),
{REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041)}, REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041),
{REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff)}, REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff),
{REALTEK_USB_DEVICE(VENDOR_ID_TPLINK, 0x0601)}, REALTEK_USB_DEVICE(VENDOR_ID_TPLINK, 0x0601),
{} {}
}; };
......
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