[PATCH net-next] r8152; preserve device list format

From: Bjørn Mork
Date: Thu Jan 12 2023 - 05:06:08 EST


This is a partial revert of commit ec51fbd1b8a2 ("r8152:
add USB device driver for config selection")

Keep a simplified version of the REALTEK_USB_DEVICE macro
to avoid unnecessary reformatting of the device list. This
makes new device ID additions apply cleanly across driver
versions.

Fixes: ec51fbd1b8a2 ("r8152: add USB device driver for config selection")
Signed-off-by: Bjørn Mork <bjorn@xxxxxxx>
---
The patch in
https://lore.kernel.org/lkml/20230111133228.190801-1-andre.przywara@xxxxxxx/
will apply cleanly on top of this.

This fix will also prevent a lot of stable backporting hassle.

Sorry for not thinking the change completely through before
submitting. I should never have touched the rtl8152_table.


Bjørn

drivers/net/usb/r8152.c | 48 +++++++++++++++++++++--------------------
1 file changed, 25 insertions(+), 23 deletions(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 66e70b5f8417..3d4631dae00f 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -9817,34 +9817,36 @@ static void rtl8152_disconnect(struct usb_interface *intf)
}
}

+#define REALTEK_USB_DEVICE(vend, prod) { USB_DEVICE(vend, prod) }
+
/* table of devices that work with this driver */
static const struct usb_device_id rtl8152_table[] = {
/* Realtek */
- { USB_DEVICE(VENDOR_ID_REALTEK, 0x8050) },
- { USB_DEVICE(VENDOR_ID_REALTEK, 0x8053) },
- { USB_DEVICE(VENDOR_ID_REALTEK, 0x8152) },
- { USB_DEVICE(VENDOR_ID_REALTEK, 0x8153) },
- { USB_DEVICE(VENDOR_ID_REALTEK, 0x8155) },
- { USB_DEVICE(VENDOR_ID_REALTEK, 0x8156) },
+ REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8050),
+ REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8053),
+ REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152),
+ REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153),
+ REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8155),
+ REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8156),

/* Microsoft */
- { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab) },
- { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6) },
- { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927) },
- { USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101) },
- { USB_DEVICE(VENDOR_ID_LENOVO, 0x304f) },
- { USB_DEVICE(VENDOR_ID_LENOVO, 0x3054) },
- { USB_DEVICE(VENDOR_ID_LENOVO, 0x3062) },
- { USB_DEVICE(VENDOR_ID_LENOVO, 0x3069) },
- { USB_DEVICE(VENDOR_ID_LENOVO, 0x3082) },
- { USB_DEVICE(VENDOR_ID_LENOVO, 0x7205) },
- { USB_DEVICE(VENDOR_ID_LENOVO, 0x720c) },
- { USB_DEVICE(VENDOR_ID_LENOVO, 0x7214) },
- { USB_DEVICE(VENDOR_ID_LENOVO, 0x721e) },
- { USB_DEVICE(VENDOR_ID_LENOVO, 0xa387) },
- { USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041) },
- { USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff) },
- { USB_DEVICE(VENDOR_ID_TPLINK, 0x0601) },
+ REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab),
+ REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6),
+ REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927),
+ REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101),
+ REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f),
+ REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3054),
+ REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062),
+ REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3069),
+ REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3082),
+ REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205),
+ REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c),
+ REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7214),
+ REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x721e),
+ REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0xa387),
+ REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041),
+ REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff),
+ REALTEK_USB_DEVICE(VENDOR_ID_TPLINK, 0x0601),
{}
};

--
2.30.2