Re: [PATCH v2 0/4] media: add and use fwnode_graph_for_each_endpoint_scoped()

From: Laurent Pinchart

Date: Wed Jun 24 2026 - 15:19:52 EST


Hi Frank,

On Wed, Jun 24, 2026 at 01:00:08PM -0400, Frank.Li@xxxxxxxxxxx wrote:
> Add new helper macro fwnode_graph_for_each_endpoint_scoped() and use it
> simplify media code.
>
> Typical example should qualcomm's driver (camss.c), the v4l2_mc.c and
> rkisp1-dev.c only silience improvement.
>
> Anyways, *_for_each_*_scoped() already use widely and make code clean.
>
> Build test only.
>
> Sakari Ailus:
> when I try to improve the patch
> "Add common helper library for 1-to-1 subdev registration", I found need
> camss.c pattern, so I create this small improvement firstly.

Those are nice cleanups, thank you.

After applying this series, the only left users of the
fwnode_graph_for_each_endpoint() macro are in drivers/base/property.c.
They can all be trivially replaced with the scoped variant. Should we
add a patch to use fwnode_graph_for_each_endpoint_scoped() everywhere,
and drop fwnode_graph_for_each_endpoint() ?

> Signed-off-by: Frank Li <Frank.Li@xxxxxxx>
> ---
> Changes in v2:
> - colllect review by tags
> - fix typo and indent.
> - see each patch's change log.
> - Link to v1: https://patch.msgid.link/20260622-fw_scoped-v1-0-a37d0aac0a68@xxxxxxx
>
> ---
> Frank Li (4):
> device property: Introduce fwnode_graph_for_each_endpoint_scoped()
> media: mc: use fwnode_graph_for_each_endpoint_scoped() to simpilfy code
> media: rkisp1: use fwnode_graph_for_each_endpoint_scoped() to simplify code
> media: qcom: camss: use fwnode_graph_for_each_endpoint_scoped() to simplify code
>
> drivers/media/platform/qcom/camss/camss.c | 17 +++++------------
> drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 4 +---
> drivers/media/v4l2-core/v4l2-mc.c | 5 +----
> include/linux/property.h | 5 +++++
> 4 files changed, 12 insertions(+), 19 deletions(-)
> ---
> base-commit: 3ce97bd3c4f18608335e709c24d6a40e7036cab8
> change-id: 20260620-fw_scoped-5dab644510a1

--
Regards,

Laurent Pinchart