From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Frank.Li@oss.nxp.com
Cc: Daniel Scally <djrscally@gmail.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Dafna Hirschfeld <dafna@fastmail.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Heiko Stuebner <heiko@sntech.de>,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Loic Poulain <loic.poulain@oss.qualcomm.com>,
driver-core@lists.linux.dev, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
linux-rockchip@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org, imx@lists.linux.dev,
Guoniu Zhou <guoniu.zhou@nxp.com>, Frank Li <Frank.Li@nxp.com>
Subject: Re: [PATCH 1/4] device property: Introduce fwnode_graph_for_each_endpoint_scoped()
Date: Tue, 23 Jun 2026 13:09:24 +0300 [thread overview]
Message-ID: <ajpbVCGGKchNa2rd@ashevche-desk.local> (raw)
In-Reply-To: <20260622-fw_scoped-v1-1-a37d0aac0a68@nxp.com>
On Mon, Jun 22, 2026 at 10:30:11AM -0400, Frank.Li@oss.nxp.com wrote:
> From: Frank Li <Frank.Li@nxp.com>
>
> Similar to recently propose for_each_child_of_node_scoped() this new
> version of the loop macro instantiates a new local struct fwnode_handle *
> that uses the __free(fwnode_handle) auto cleanup handling so that if a
> reference to a node is held on early exit from the loop the reference will
> be released. If the loop runs to completion, the child pointer will be NULL
> and no action will be taken.
>
> The reason this is useful is that it removes the need for
> fwnode_handle_put() on early loop exits. If there is a need to retain the
Just be consistent with 1-space versus 2-spaces gaps in the same text.
> reference, then return_ptr(child) or no_free_ptr(child) may be used to
> safely disable the auto cleanup.
No objections from me.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
See one nit-pick below.
But you will need driver core maintainers to Ack this.
...
> +#define fwnode_graph_for_each_endpoint_scoped(fwnode, child) \
> + for (struct fwnode_handle *child __free(fwnode_handle) = \
> + fwnode_graph_get_next_endpoint(fwnode, NULL); \
You should follow the existing style, the 'f' in fwnode should be under 'u' in
struct.
> + child; child = fwnode_graph_get_next_endpoint(fwnode, child))
--
With Best Regards,
Andy Shevchenko
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Frank.Li@oss.nxp.com
Cc: Daniel Scally <djrscally@gmail.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Dafna Hirschfeld <dafna@fastmail.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Heiko Stuebner <heiko@sntech.de>,
Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Loic Poulain <loic.poulain@oss.qualcomm.com>,
driver-core@lists.linux.dev, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
linux-rockchip@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org, imx@lists.linux.dev,
Guoniu Zhou <guoniu.zhou@nxp.com>, Frank Li <Frank.Li@nxp.com>
Subject: Re: [PATCH 1/4] device property: Introduce fwnode_graph_for_each_endpoint_scoped()
Date: Tue, 23 Jun 2026 13:09:24 +0300 [thread overview]
Message-ID: <ajpbVCGGKchNa2rd@ashevche-desk.local> (raw)
In-Reply-To: <20260622-fw_scoped-v1-1-a37d0aac0a68@nxp.com>
On Mon, Jun 22, 2026 at 10:30:11AM -0400, Frank.Li@oss.nxp.com wrote:
> From: Frank Li <Frank.Li@nxp.com>
>
> Similar to recently propose for_each_child_of_node_scoped() this new
> version of the loop macro instantiates a new local struct fwnode_handle *
> that uses the __free(fwnode_handle) auto cleanup handling so that if a
> reference to a node is held on early exit from the loop the reference will
> be released. If the loop runs to completion, the child pointer will be NULL
> and no action will be taken.
>
> The reason this is useful is that it removes the need for
> fwnode_handle_put() on early loop exits. If there is a need to retain the
Just be consistent with 1-space versus 2-spaces gaps in the same text.
> reference, then return_ptr(child) or no_free_ptr(child) may be used to
> safely disable the auto cleanup.
No objections from me.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
See one nit-pick below.
But you will need driver core maintainers to Ack this.
...
> +#define fwnode_graph_for_each_endpoint_scoped(fwnode, child) \
> + for (struct fwnode_handle *child __free(fwnode_handle) = \
> + fwnode_graph_get_next_endpoint(fwnode, NULL); \
You should follow the existing style, the 'f' in fwnode should be under 'u' in
struct.
> + child; child = fwnode_graph_get_next_endpoint(fwnode, child))
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-06-23 10:09 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 14:30 [PATCH 0/4] media: add and use fwnode_graph_for_each_endpoint_scoped() Frank.Li
2026-06-22 14:30 ` Frank.Li
2026-06-22 14:30 ` [PATCH 1/4] device property: Introduce fwnode_graph_for_each_endpoint_scoped() Frank.Li
2026-06-22 14:30 ` Frank.Li
2026-06-23 10:09 ` Andy Shevchenko [this message]
2026-06-23 10:09 ` Andy Shevchenko
2026-06-22 14:30 ` [PATCH 2/4] media: mc: use fwnode_graph_for_each_endpoint_scoped() to simpilfy code Frank.Li
2026-06-22 14:30 ` Frank.Li
2026-06-22 14:30 ` [PATCH 3/4] media: rkisp1: use fwnode_graph_for_each_endpoint_scoped() to simplify code Frank.Li
2026-06-22 14:30 ` Frank.Li
2026-06-23 10:16 ` Andy Shevchenko
2026-06-23 10:16 ` Andy Shevchenko
2026-06-22 14:30 ` [PATCH 4/4] media: qcom: camss: use fwnode_graph_for_each_endpoint_scoped() to simpifly code Frank.Li
2026-06-22 14:30 ` Frank.Li
2026-06-23 11:54 ` Loic Poulain
2026-06-23 11:54 ` Loic Poulain
2026-06-23 10:17 ` [PATCH 0/4] media: add and use fwnode_graph_for_each_endpoint_scoped() Andy Shevchenko
2026-06-23 10:17 ` Andy Shevchenko
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=ajpbVCGGKchNa2rd@ashevche-desk.local \
--to=andriy.shevchenko@linux.intel.com \
--cc=Frank.Li@nxp.com \
--cc=Frank.Li@oss.nxp.com \
--cc=bryan.odonoghue@linaro.org \
--cc=dafna@fastmail.com \
--cc=dakr@kernel.org \
--cc=djrscally@gmail.com \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=guoniu.zhou@nxp.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=heiko@sntech.de \
--cc=imx@lists.linux.dev \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=mchehab@kernel.org \
--cc=rafael@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=vladimir.zapolskiy@linaro.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.