[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <671ccf0e-7b98-405f-b973-4ffb6996092b@ti.com>
Date: Thu, 27 Mar 2025 12:01:36 +0530
From: Devarsh Thakkar <devarsht@...com>
To: Jai Luthra <jai.luthra@...asonboard.com>,
Jai Luthra
<jai.luthra@...ux.dev>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Hans
Verkuil <hverkuil@...all.nl>,
Tomi Valkeinen
<tomi.valkeinen@...asonboard.com>,
Sakari Ailus
<sakari.ailus@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>
CC: Rishikesh Donadkar <r-donadkar@...com>,
Vaishnav Achath
<vaishnav.a@...com>,
Changhuang Liang <changhuang.liang@...rfivetech.com>,
<linux-media@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/6] media: ti: j721e-csi2rx: Use
fwnode_get_named_child_node
On 24/03/25 17:31, Jai Luthra wrote:
> Simplify notifier registration logic. Instead of first getting the
> device node, get the fwnode of the child directly.
>
> Signed-off-by: Jai Luthra <jai.luthra@...asonboard.com>
Reviewed-by: Devarsh Thakkar <devarsht@...com>
Regards
Devarsh
> ---
> drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c | 19 +++++++++----------
> 1 file changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> index a066024bf745450e2ba01d06c0fec4e6bdbfa97e..6d406925e092660cb67c04cc2a7e1e10c14e295e 100644
> --- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> +++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c
> @@ -13,6 +13,7 @@
> #include <linux/module.h>
> #include <linux/of_platform.h>
> #include <linux/platform_device.h>
> +#include <linux/property.h>
>
> #include <media/mipi-csi2.h>
> #include <media/v4l2-device.h>
> @@ -450,25 +451,23 @@ static int ti_csi2rx_notifier_register(struct ti_csi2rx_dev *csi)
> {
> struct fwnode_handle *fwnode;
> struct v4l2_async_connection *asc;
> - struct device_node *node;
> int ret;
>
> - node = of_get_child_by_name(csi->dev->of_node, "csi-bridge");
> - if (!node)
> + fwnode = fwnode_get_named_child_node(csi->dev->fwnode, "csi-bridge");
> + if (!fwnode)
> return -EINVAL;
>
> - fwnode = of_fwnode_handle(node);
> - if (!fwnode) {
> - of_node_put(node);
> - return -EINVAL;
> - }
> -
> v4l2_async_nf_init(&csi->notifier, &csi->v4l2_dev);
> csi->notifier.ops = &csi_async_notifier_ops;
>
> asc = v4l2_async_nf_add_fwnode(&csi->notifier, fwnode,
> struct v4l2_async_connection);
> - of_node_put(node);
> + /*
> + * Calling v4l2_async_nf_add_fwnode grabs a refcount,
> + * so drop the one we got in fwnode_get_named_child_node
> + */
> + fwnode_handle_put(fwnode);
> +
> if (IS_ERR(asc)) {
> v4l2_async_nf_cleanup(&csi->notifier);
> return PTR_ERR(asc);
>
Powered by blists - more mailing lists