Skip to content

Commit 95a4c1d

Browse files
hayesorzkuba-moo
authored andcommitted
r8152: remove rtl_vendor_mode function
After commit ec51fbd ("r8152: add USB device driver for config selection"), the code about changing USB configuration in rtl_vendor_mode() wouldn't be run anymore. Therefore, the function could be removed. Signed-off-by: Hayes Wang <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b3c588c commit 95a4c1d

File tree

1 file changed

+1
-38
lines changed

1 file changed

+1
-38
lines changed

drivers/net/usb/r8152.c

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8232,43 +8232,6 @@ static bool rtl_check_vendor_ok(struct usb_interface *intf)
82328232
return true;
82338233
}
82348234

8235-
static bool rtl_vendor_mode(struct usb_interface *intf)
8236-
{
8237-
struct usb_host_interface *alt = intf->cur_altsetting;
8238-
struct usb_device *udev;
8239-
struct usb_host_config *c;
8240-
int i, num_configs;
8241-
8242-
if (alt->desc.bInterfaceClass == USB_CLASS_VENDOR_SPEC)
8243-
return rtl_check_vendor_ok(intf);
8244-
8245-
/* The vendor mode is not always config #1, so to find it out. */
8246-
udev = interface_to_usbdev(intf);
8247-
c = udev->config;
8248-
num_configs = udev->descriptor.bNumConfigurations;
8249-
if (num_configs < 2)
8250-
return false;
8251-
8252-
for (i = 0; i < num_configs; (i++, c++)) {
8253-
struct usb_interface_descriptor *desc = NULL;
8254-
8255-
if (c->desc.bNumInterfaces > 0)
8256-
desc = &c->intf_cache[0]->altsetting->desc;
8257-
else
8258-
continue;
8259-
8260-
if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC) {
8261-
usb_driver_set_configuration(udev, c->desc.bConfigurationValue);
8262-
break;
8263-
}
8264-
}
8265-
8266-
if (i == num_configs)
8267-
dev_err(&intf->dev, "Unexpected Device\n");
8268-
8269-
return false;
8270-
}
8271-
82728235
static int rtl8152_pre_reset(struct usb_interface *intf)
82738236
{
82748237
struct r8152 *tp = usb_get_intfdata(intf);
@@ -9629,7 +9592,7 @@ static int rtl8152_probe(struct usb_interface *intf,
96299592
if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC)
96309593
return -ENODEV;
96319594

9632-
if (!rtl_vendor_mode(intf))
9595+
if (!rtl_check_vendor_ok(intf))
96339596
return -ENODEV;
96349597

96359598
usb_reset_device(udev);

0 commit comments

Comments
 (0)