Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp390452lqc; Thu, 7 Mar 2024 23:53:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVouhb+A1kEjMWNMuh3XhUNv/ZrKhEQ/P4sJPYqTNhFsLJGESSwXaTOTrDfeEXBNS0nOQfQDQrh2MbUnNjleBFJrR263MaaYasZinzyZQ== X-Google-Smtp-Source: AGHT+IEaLXzISv1zRp6vTb/mXsxP1zLN6DIsOLmtc0IXUtvocd9DephuVwsqTpNT/Wc165eVZVza X-Received: by 2002:a05:6358:98a4:b0:17b:b369:aeba with SMTP id q36-20020a05635898a400b0017bb369aebamr10643600rwa.21.1709884417647; Thu, 07 Mar 2024 23:53:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709884417; cv=pass; d=google.com; s=arc-20160816; b=FXDnlHkCOUcW6Zngk0RnaQmLPpxtujbffBuITCKoPTqy5pRNJsP0RpVq94eDIj1etP kfmWBitkIJmbN03fhH2+73VbW6/ADFUii9hj+lfjN61A1JruaqFWRRk/d8nHJb1mQout iNmNft9yyza1wWbGmlmYWwmZ7/XwDifD+MYxZWwhPC04AwgSwNEXpsDcIKNcMw4CWNAA Y5y3U2BCnmlBH8rI0Bja4do/a8/nsAcLPRBKtmtB80NmgO9Yp4cVuolZURr/HFOLvhc6 0OFpGORazKDx/f4r8/E5bbkpMoXx0v2J1ID5931UxfU9m1ASe6/0B3BNTuH4iybqtqNF hEig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=HlVKDL1+5Pv/WiZ9/fGlsyHMeF9bmAreeAo1SaeQeFs=; fh=asqeH3O/QnyRb7t/jKhooxi2j9EYs9s/QOPv512F3oU=; b=Pep1BLXPlgUfR8BOZ+OkFlVLHR8rV4V51JJnrY3ExwSGOiXt62PWqpJpYDMN/Xcwrm mGuTTC6av0vuWzd2lX+pdRCnhvyVX2q7LY0wAM9mrFkDLT52HI+T8gzbnI+1CxhTADzf 36s2raR/NVUVYk/t2S+VhQ8rQL8o+OfRow8ZKHmmU1JTWsdvan+pSqdGb6MIoCFjre9n 4L1X10Nr3Ih9bKuCGzyCvten9kwgOObXLha0OUbFCLBpg9BsuWHNR3uSIW2CersPizDr 8zt9LGU1tpal/+2J9GOyWFu3WW8sLkynm7239R1Hco+egN5+HmMRL38AFnNmaIOFbeCY hqoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-kernel+bounces-96606-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96606-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b26-20020a6567da000000b005dcbb6b06bbsi15578100pgs.292.2024.03.07.23.53.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 23:53:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96606-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-kernel+bounces-96606-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96606-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 62048284735 for ; Fri, 8 Mar 2024 07:53:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C8CC524A7; Fri, 8 Mar 2024 07:53:02 +0000 (UTC) Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 484E74F61D; Fri, 8 Mar 2024 07:52:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709884382; cv=none; b=DCQY2Zwn/BBqx4UcxjD/ZAPT32AqbQHCsBZ7E80o9ww8YKeaVN5ChfXF3onj7XUtGCaYLi1q4pQHIt4eLYPDRHgGtHlV7pYJUmJZ1AzECVAbyih2UzRNnK16cJR+rOxwjhLRQlmcZ0mSw38uy24VQRyco9Ri2pz81vS1KgwvC0Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709884382; c=relaxed/simple; bh=plk1XpvlB+tBdxjoQXMNOo0U73Y5H1GaU8aJioRRm7Q=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=TybWqL5FmNKJ8wgg70j75SbNuOrmoxAn7Wyunbtr8i6sJg3FAz9I91EpAZ0/pFKw5r5qe/z7HIkbd3vaE7BG8bohfeak1RO6F0rpqx0KX/Si2Ml0ZvJ8j3ar4cGjWpUXURnTZCE1pBPhM4MGiS9F4i3ml6KLzuHIOkCUkPDYRZs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4287qeK631940758, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 4287qeK631940758 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 8 Mar 2024 15:52:40 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 8 Mar 2024 15:52:40 +0800 Received: from fc38.realtek.com.tw (172.22.228.98) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 8 Mar 2024 15:52:39 +0800 From: Hayes Wang To: , CC: , , , , Hayes Wang Subject: [PATCH net] r8152: fix unknown device for choose_configuration Date: Fri, 8 Mar 2024 15:52:06 +0800 Message-ID: <20240308075206.33553-436-nic_swsd@realtek.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: RTEXH36506.realtek.com.tw (172.21.6.27) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXH36505.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback 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 --- drivers/net/usb/r8152.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.43.0