Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp343216lqb; Tue, 4 Jun 2024 13:07:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvR0HxO2EuZOies2OctWzNVoz4uJMIoLkN+4Y0wXV6y8JRTpWhz/2b5t64+JDSLLPKzFnnNElsP94ivpMTVj7ikCD7JdU5mMuFbdUxbg== X-Google-Smtp-Source: AGHT+IHWR6EB2yl6G0hAuo69qC4Eh3yTyottyZ3kv6SR2SGe5GNKI1TVLx1pdvAIm/XWpKJE40oi X-Received: by 2002:a05:6214:3d0a:b0:6af:f898:3c15 with SMTP id 6a1803df08f44-6b02bf10347mr4340976d6.2.1717531647206; Tue, 04 Jun 2024 13:07:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717531647; cv=pass; d=google.com; s=arc-20160816; b=HT9jeLeqc63KtQOltI9rl+J9ERdlz6pDqTMXm7j1xZ2bAPbPfYQ9UcXSj9hDfrTtLy HhwM4n8+Wxx4LmRUqZTdp/pyFE5LpC69wxhCEJ1+jb7seLtWxHU+9egrPACy++xuFfMT 04usB0imNNZl1lKR7LCLWiftnD9R76WI+aC1cIQrobvYgaFzl85EEU/u0B+YELhV6xsa AP5ZpZrzXifRMdBHTw5epuXhB+PxxzueYf8ATgREUuy1i2wmQD/UfbALdNy8AlXL9FR9 E+9dlTF5AT4ywXSooL6ULN1oOg1gOPXMIGhTY+1psjKfC/EsSn184QDpvWxShMoeRtYR x4RA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:subject:from:cc :content-language:to:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=uhHW9GGQMJyeKuzBVKGCIeAGb0QutdaJfivNQuDOQqg=; fh=qG9mnhuQfUPt8u8WuJc3hoT59EJuu+gxf1wtmUb+7vI=; b=ozJe3ngyUipuMhhXqzAk1xcDTxPpaGmp2YpTl6FtM/dQVmv/BD1eRyq3XyxfmB9zyg HHxdFfckeznNQuzJpK8UiC2XYUenQjJQ31YKEcyzc0iz4dFKcvbrCltOfn3lM3ouSLY1 bie7X3JMW5TdBIr//fQn8ygFRBq13rk+0kO2VOAguyodgYTNCqUlcG6JK3xp23twGlOa LaGCuwVpL8EcGyY6NaSnEDlmOwGHOJEbvn0cfFprXwKVfQvTMrq3Li16zMEfV6SbWEVE GA4FtJJJcywFY6ZItd3/s1Gj8tmIpVG9byTm/3Jef1ojhkmCLGXuCpmy7iZqlJQWwX/8 XBIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=rYzgXPGN; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-201329-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201329-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b43ec62si33363996d6.610.2024.06.04.13.07.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 13:07:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201329-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=rYzgXPGN; arc=pass (i=1 spf=pass spfdomain=web.de dkim=pass dkdomain=web.de dmarc=pass fromdomain=web.de); spf=pass (google.com: domain of linux-kernel+bounces-201329-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201329-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E7CE91C22FDC for ; Tue, 4 Jun 2024 20:07:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DFF1814C59A; Tue, 4 Jun 2024 20:06:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="rYzgXPGN" Received: from mout.web.de (mout.web.de [212.227.17.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CD3B1350FD; Tue, 4 Jun 2024 20:06:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.17.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717531601; cv=none; b=Mxk2v4biQfCHKujK7FI1zj5qfxtkexUfy8K+d81ovlArP1iAqk73l8paGZkHrxQX6Vr+ub1riMtLghXCba/paSp4wqvayTe1J13+/4bYFBmtJcQi597xNB3ixobGx+Mxk8/KdrGwG/9IgqTzTB/8td5uN1EmPU09nYI/Q56E6O4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717531601; c=relaxed/simple; bh=UyYvcyDzvOULQA5s2EXEzktbfL5xmUY+eN5IYMYeDPE=; h=Message-ID:Date:MIME-Version:To:Cc:From:Subject:Content-Type; b=EbKgkb7EUpxQele3blrndPnf2wLV2wFcADtDu/FTXRjf1CMAugF69fqM3mUAYUKbMqlRE1Ljj6c/RJEbDpZrVtBo7XeYwvI5Pli7oAhaxmA4PTaN92KGGyE8Dfzud+OJ9C667C6/OqHGJp237y9E/ZY2kQPLkiBtF0uCuu37nSk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b=rYzgXPGN; arc=none smtp.client-ip=212.227.17.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1717531581; x=1718136381; i=markus.elfring@web.de; bh=uhHW9GGQMJyeKuzBVKGCIeAGb0QutdaJfivNQuDOQqg=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:To:Cc:From: Subject:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=rYzgXPGNju40m3dtl+VNlpzgxfCNptFUl4EL+/gtnyN5uUp28+yWnmOlPyGEFmgO kNlK8f6hqLSfIE+M1WVlUHPpktTDywxRrpbxHHxfN1nci0xBvgRijfzN6KiMdYFt9 mmNcCwoYuteM61RJ3ao9PBmdH4PbpRMKPJsaZbJE+l4KOzTZupzd4Tt0mHp+Nj0Lc pYI+mSGvvHLkrLcNiqIehL7Co/DFoBF+RU8R8yEIlgLlQ9AHB30Jvc88rrFLSSF6r Ea/uwy/6uvOOSW9gwfUN2+ZYSX1LbNVeqa0Ej99m8X/BAqUXWzgXPaEOPZ53zgjuH j21sBwlox4ZXBJfQPA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.83.95]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MsaRt-1sTEak1TQJ-00u3fa; Tue, 04 Jun 2024 22:06:21 +0200 Message-ID: <532aa50e-b8e5-4e8e-a2bd-a05fd81274dc@web.de> Date: Tue, 4 Jun 2024 22:06:14 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: kernel-janitors@vger.kernel.org, Chanwoo Choi , MyungJoo Ham , Stanley Chang Content-Language: en-GB Cc: LKML , Andy Shevchenko From: Markus Elfring Subject: [PATCH] extcon: realtek: Use scope-based resource management in extcon_rtk_type_c_init() Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:0bU/ob+7kOatF+Jz8t5uLaM4o08nrxHMvPvk17RGGz5HLVViqNf qfYph/J4pM7wUvoDWFDckjjDi7jyfZQGyF6wPNDWq/tpstxR6SPkGdaQyw4euoWWTily9pW G+kDuJVD5kxkQjvr61PUe1fH/0qiSPhp3pk8dhhKfruf4zlZtMsNRPUaRreugj7ZzxGzasH bBFVGpJN2omsakJnVmBGw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:G+pSpadvric=;2EdbEimaqR1zhnAl1Odt2yDHrIZ j2XPfbzrkmiVTG1OeuCx1a58gDVUOCVQDgt4HrCeckwzyUJItFRZr5RLKcgILgsXljwUNISWs G+HdNEoh1BSOq7MXaELkRfimlCsdGh3ijPMTYz+g/apY2j5xoJTwaztHvWET7w5pbmTdZvd6E SWfMIjf2LL3TuDb9SKBHKJe5XcvGNxZ9awzL/c+TAxP4xhNL2ubBa9R6/wlp3n6HDFvBfq/CX 0pInHr5v5AdBe2GTVgrlaOKZK0uQYGsLGtlTklHq0CUB/HVa9g2oRGy39UXWBkDitznLbsrSZ AUKMCN/OKHirU61Tj+l7z4WhmM6vbnCXcOQQqUHoN9SGePYyftjx4NDger5+vsGaifqDrKsKO jEu79XqxIOWlvZ7KGJYjT6MOnoXNU/737tBd/j5hPtEqsk5GbeOTIb89XhPEbsgsmZH9PZzOg 4KOQ3QtwP5OfEBSbNYSQnFezCYGg0wUNFz4Fm2Zk0vBfkyTptelpRoUxn9wdQEaZmLb/Vw4pe 6J+aVk/0x9fenrmtBWnxxbhDly4h9ZwtnDkVfOdGqBRnqcZl3HcBHRcl2AtDa9BQ5+uSWfKu6 I77mQAddGs9BXVoXNJMOAmy4QZao0Lt6Rj3EKhzfpMnAgYyOxlxZO1+lEtjKqW84mCsL6vxtJ Xo89EdpnbF4SnwM/ev7PMeIJzg7Or9PCRusN/VRtQ3Atai16K+dnNo4Coyb1cucXQIAhPJZmb YvNDZak7utenWSF+ifoDY7KAHw/UNvdVCcsOFwRYh9Pd0V7PN6HImgizXTcVO2C8Se86M0mtd GyqZf7GOqtoyOyznNWtN3K41G2vWCcNzFs72Eob1tFF0s= From: Markus Elfring Date: Tue, 4 Jun 2024 21:55:08 +0200 Scope-based resource management became supported also for another programming interface by contributions of Jonathan Cameron on 2024-02-17. See also the commit 59ed5e2d505bf5f9b4af64d0021cd0c96aec1f7c ("device property: Add cleanup.h based fwnode_handle_put() scope based cleanup."). * Thus use the attribute =E2=80=9C__free(fwnode_handle)=E2=80=9D. * Reduce the scope for the local variable =E2=80=9Cfwnode=E2=80=9D. Fixes: 8a590d7371f0 ("extcon: add Realtek DHC RTD SoC Type-C driver") Signed-off-by: Markus Elfring =2D-- drivers/extcon/extcon-rtk-type-c.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/extcon/extcon-rtk-type-c.c b/drivers/extcon/extcon-rt= k-type-c.c index 19a01e663733..8a4b074fd745 100644 =2D-- a/drivers/extcon/extcon-rtk-type-c.c +++ b/drivers/extcon/extcon-rtk-type-c.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -1237,7 +1238,6 @@ static int extcon_rtk_type_c_init(struct type_c_data= *type_c) if (!type_c->port) { struct typec_capability typec_cap =3D { }; - struct fwnode_handle *fwnode; const char *buf; int ret; @@ -1246,7 +1246,8 @@ static int extcon_rtk_type_c_init(struct type_c_data= *type_c) typec_cap.driver_data =3D type_c; typec_cap.ops =3D &type_c_port_ops; - fwnode =3D device_get_named_child_node(dev, "connector"); + struct fwnode_handle *fwnode __free(fwnode_handle) + =3D device_get_named_child_node(dev, "connector"); if (!fwnode) return -EINVAL; =2D- 2.45.1