diff mbox series

[net] r8152: fix unknown device for choose_configuration

Message ID 20240308075206.33553-436-nic_swsd@realtek.com (mailing list archive)
State Accepted
Commit 46590b545df636aea0f9f7f2100d9963c0af5824
Delegated to: Netdev Maintainers
Headers show
Series [net] r8152: fix unknown device for choose_configuration | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 956 this patch: 956
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 3 blamed authors not CCed: grundler@chromium.org dianders@chromium.org gregkh@linuxfoundation.org; 5 maintainers not CCed: pabeni@redhat.com grundler@chromium.org dianders@chromium.org edumazet@google.com gregkh@linuxfoundation.org
netdev/build_clang success Errors and warnings before: 972 this patch: 972
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 972 this patch: 972
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-08--09-00 (tests: 890)

Commit Message

Hayes Wang March 8, 2024, 7:52 a.m. UTC
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: aa4f2b3e418e ("r8152: Choose our USB config with choose_configuration() rather than probe()")
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/usb/r8152.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+netdevbpf@kernel.org March 11, 2024, 11 p.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 8 Mar 2024 15:52:06 +0800 you wrote:
> 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: aa4f2b3e418e ("r8152: Choose our USB config with choose_configuration() rather than probe()")
> Signed-off-by: Hayes Wang <hayeswang@realtek.com>
> 
> [...]

Here is the summary with links:
  - [net] r8152: fix unknown device for choose_configuration
    https://git.kernel.org/netdev/net/c/46590b545df6

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 0d0672d2a654..51fe00c2b896 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -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;