Skip to content

Commit

Permalink
r8152: fix unknown device for choose_configuration
Browse files Browse the repository at this point in the history
For the unknown device, rtl8152_cfgselector_choose_configuration()
should return a negative value. Then, usb_choose_configuration() would
set a configuration for CDC ECM or NCM mode. Otherwise, there is no
usb interface driver for the device.

Fixes: aa4f2b3 ("r8152: Choose our USB config with choose_configuration() rather than probe()")
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Link: https://lore.kernel.org/r/20240308075206.33553-436-nic_swsd@realtek.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Hayes Wang authored and Jakub Kicinski committed Mar 11, 2024
1 parent 8f4cd89 commit 46590b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/usb/r8152.c
Original file line number Diff line number Diff line change
Expand Up @@ -10078,7 +10078,7 @@ static int rtl8152_cfgselector_choose_configuration(struct usb_device *udev)
* driver supports it.
*/
if (__rtl_get_hw_ver(udev) == RTL_VER_UNKNOWN)
return 0;
return -ENODEV;

/* The vendor mode is not always config #1, so to find it out. */
c = udev->config;
Expand Down

0 comments on commit 46590b5

Please sign in to comment.