All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Ballance <andrewjballance@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org,
	Thinh.Nguyen@synopsys.com,
	linux-kernel-mentees@lists.linuxfoundation.org,
	skhan@linuxfoundation.org,
	Andrew Ballance <andrewjballance@gmail.com>
Subject: [PATCH] usb/dwc3: replace of_node_put with __free
Date: Fri,  5 Apr 2024 21:48:38 -0500	[thread overview]
Message-ID: <20240406024838.537630-1-andrewjballance@gmail.com> (raw)

this relaces instances of of_node_put with __free(device_node)
in drivers/usb/dwc3/core.c

Signed-off-by: Andrew Ballance <andrewjballance@gmail.com>
---
 drivers/usb/dwc3/core.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 31684cdaaae3..795a572d46cf 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1762,7 +1762,7 @@ static void dwc3_check_params(struct dwc3 *dwc)
 static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc)
 {
 	struct device *dev = dwc->dev;
-	struct device_node *np_phy;
+	struct device_node *np_phy __free(device_node);
 	struct extcon_dev *edev = NULL;
 	const char *name;
 
@@ -1797,14 +1797,12 @@ static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc)
 	 */
 	np_phy = of_parse_phandle(dev->of_node, "phys", 0);
 	if (of_graph_is_present(np_phy)) {
-		struct device_node *np_conn;
+		struct device_node *np_conn __free(device_node);
 
 		np_conn = of_graph_get_remote_node(np_phy, -1, -1);
 		if (np_conn)
 			edev = extcon_find_edev_by_node(np_conn);
-		of_node_put(np_conn);
 	}
-	of_node_put(np_phy);
 
 	return edev;
 }
@@ -1915,14 +1913,13 @@ static int dwc3_probe(struct platform_device *pdev)
 	dwc_res.start += DWC3_GLOBALS_REGS_START;
 
 	if (dev->of_node) {
-		struct device_node *parent = of_get_parent(dev->of_node);
+		struct device_node *parent __free(device_node) = of_get_parent(dev->of_node);
 
 		if (of_device_is_compatible(parent, "realtek,rtd-dwc3")) {
 			dwc_res.start -= DWC3_GLOBALS_REGS_START;
 			dwc_res.start += DWC3_RTK_RTD_GLOBALS_REGS_START;
 		}
 
-		of_node_put(parent);
 	}
 
 	regs = devm_ioremap_resource(dev, &dwc_res);
-- 
2.44.0


             reply	other threads:[~2024-04-06  2:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-06  2:48 Andrew Ballance [this message]
2024-04-09  0:20 ` [PATCH] usb/dwc3: replace of_node_put with __free Thinh Nguyen
2024-04-09 15:19 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240406024838.537630-1-andrewjballance@gmail.com \
    --to=andrewjballance@gmail.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.