kernel: bump 6.1 to 6.1.68
[openwrt/staging/stintel.git] / target / linux / generic / backport-6.1 / 795-v6.3-04-r8152-remove-rtl_vendor_mode-function.patch
1 From 95a4c1d617b92cdc4522297741b56e8f6cd01a1e Mon Sep 17 00:00:00 2001
2 From: Hayes Wang <hayeswang@realtek.com>
3 Date: Thu, 19 Jan 2023 15:40:42 +0800
4 Subject: [PATCH] r8152: remove rtl_vendor_mode function
5
6 After commit ec51fbd1b8a2 ("r8152: add USB device driver for
7 config selection"), the code about changing USB configuration
8 in rtl_vendor_mode() wouldn't be run anymore. Therefore, the
9 function could be removed.
10
11 Signed-off-by: Hayes Wang <hayeswang@realtek.com>
12 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
13 ---
14 drivers/net/usb/r8152.c | 39 +--------------------------------------
15 1 file changed, 1 insertion(+), 38 deletions(-)
16
17 --- a/drivers/net/usb/r8152.c
18 +++ b/drivers/net/usb/r8152.c
19 @@ -8288,43 +8288,6 @@ static bool rtl_check_vendor_ok(struct u
20 return true;
21 }
22
23 -static bool rtl_vendor_mode(struct usb_interface *intf)
24 -{
25 - struct usb_host_interface *alt = intf->cur_altsetting;
26 - struct usb_device *udev;
27 - struct usb_host_config *c;
28 - int i, num_configs;
29 -
30 - if (alt->desc.bInterfaceClass == USB_CLASS_VENDOR_SPEC)
31 - return rtl_check_vendor_ok(intf);
32 -
33 - /* The vendor mode is not always config #1, so to find it out. */
34 - udev = interface_to_usbdev(intf);
35 - c = udev->config;
36 - num_configs = udev->descriptor.bNumConfigurations;
37 - if (num_configs < 2)
38 - return false;
39 -
40 - for (i = 0; i < num_configs; (i++, c++)) {
41 - struct usb_interface_descriptor *desc = NULL;
42 -
43 - if (c->desc.bNumInterfaces > 0)
44 - desc = &c->intf_cache[0]->altsetting->desc;
45 - else
46 - continue;
47 -
48 - if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC) {
49 - usb_driver_set_configuration(udev, c->desc.bConfigurationValue);
50 - break;
51 - }
52 - }
53 -
54 - if (i == num_configs)
55 - dev_err(&intf->dev, "Unexpected Device\n");
56 -
57 - return false;
58 -}
59 -
60 static int rtl8152_pre_reset(struct usb_interface *intf)
61 {
62 struct r8152 *tp = usb_get_intfdata(intf);
63 @@ -9686,7 +9649,7 @@ static int rtl8152_probe(struct usb_inte
64 if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC)
65 return -ENODEV;
66
67 - if (!rtl_vendor_mode(intf))
68 + if (!rtl_check_vendor_ok(intf))
69 return -ENODEV;
70
71 usb_reset_device(udev);