Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Coia Prant <coiaprant@gmail.com>
Cc: netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	linux-rockchip@lists.infradead.org
Subject: Re: [PATCH net-next] net: pcs: xpcs-rk: use cleanup.h for platform_device reference
Date: Mon, 23 Nov 2026 16:11:00 +0100	[thread overview]
Message-ID: <814be8ca-6fe4-401a-af4e-206f1b67be74@lunn.ch> (raw)
In-Reply-To: <20261123123052.578956-2-coiaprant@gmail.com>

On Mon, Nov 23, 2026 at 08:30:53PM +0800, Coia Prant wrote:
> Use the __free(platform_device_put) cleanup action to manage the
> platform_device reference obtained from of_find_device_by_node().
> 
> This removes the need for explicit put_device() calls on every failure
> path and at the end of the successful path, simplifying the function
> and reducing the chance of reference leaks or double puts.
> 
> Signed-off-by: Coia Prant <coiaprant@gmail.com>

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html

Low level cleanup constructs (such as __free()) can be used when
building APIs and helpers, especially scoped iterators. However,
direct use of __free() within networking core and drivers is
discouraged.

    Andrew

---
pw-bot: cr

  reply	other threads:[~2026-11-23 15:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 12:30 [PATCH net-next] net: pcs: xpcs-rk: use cleanup.h for platform_device reference Coia Prant
2026-11-23 15:11 ` Andrew Lunn [this message]
2026-11-23 15:15   ` Coia Prant

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=814be8ca-6fe4-401a-af4e-206f1b67be74@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=coiaprant@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox