From nobody Wed Dec 31 05:29:13 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3671C4332F for ; Tue, 7 Nov 2023 09:13:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233780AbjKGJNK (ORCPT ); Tue, 7 Nov 2023 04:13:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229776AbjKGJNJ (ORCPT ); Tue, 7 Nov 2023 04:13:09 -0500 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 080D8FA; Tue, 7 Nov 2023 01:13:04 -0800 (PST) X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 3A79CrrpE4103429, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 3A79CrrpE4103429 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 7 Nov 2023 17:12:53 +0800 Received: from RTEXMBS06.realtek.com.tw (172.21.6.99) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Tue, 7 Nov 2023 17:12:53 +0800 Received: from RTEXH36506.realtek.com.tw (172.21.6.27) by RTEXMBS06.realtek.com.tw (172.21.6.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Nov 2023 17:12:52 +0800 Received: from localhost.localdomain (172.21.252.101) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server id 15.1.2507.17 via Frontend Transport; Tue, 7 Nov 2023 17:12:52 +0800 From: Stanley Chang To: Thinh Nguyen CC: Stanley Chang , Christophe JAILLET , Greg Kroah-Hartman , , Subject: [PATCH v1] usb: dwc3: add device put function to decrement the ref-counted reference Date: Tue, 7 Nov 2023 17:12:51 +0800 Message-ID: <20231107091252.11783-1-stanley_chang@realtek.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-KSE-ServerInfo: RTEXMBS06.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" When the function exits, the count should be decremented via platform_device_put and of_node_put. Fixes: 34c200483569 ("usb: dwc3: add Realtek DHC RTD SoC dwc3 glue layer dr= iver") Signed-off-by: Stanley Chang --- drivers/usb/dwc3/dwc3-rtk.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-rtk.c b/drivers/usb/dwc3/dwc3-rtk.c index 590028e8fdcb..9d6f2a8bd6ce 100644 --- a/drivers/usb/dwc3/dwc3-rtk.c +++ b/drivers/usb/dwc3/dwc3-rtk.c @@ -187,6 +187,7 @@ static enum usb_device_speed __get_dwc3_maximum_speed(s= truct device_node *np) =20 ret =3D match_string(speed_names, ARRAY_SIZE(speed_names), maximum_speed); =20 + of_node_put(dwc3_np); return (ret < 0) ? USB_SPEED_UNKNOWN : ret; } =20 @@ -339,6 +340,8 @@ static int dwc3_rtk_probe_dwc3_core(struct dwc3_rtk *rt= k) =20 switch_usb2_role(rtk, rtk->cur_role); =20 + platform_device_put(dwc3_pdev); + of_node_put(dwc3_node); return 0; =20 err_pdev_put: --=20 2.34.1