[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<PAXPR04MB9185B231F18733127969B47489E6A@PAXPR04MB9185.eurprd04.prod.outlook.com>
Date: Wed, 1 Oct 2025 20:09:46 +0000
From: Shenwei Wang <shenwei.wang@....com>
To: "Peng Fan (OSS)" <peng.fan@....nxp.com>
CC: Bjorn Andersson <andersson@...nel.org>, Mathieu Poirier
<mathieu.poirier@...aro.org>, Rob Herring <robh@...nel.org>, Krzysztof
Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Shawn Guo
<shawnguo@...nel.org>, Sascha Hauer <s.hauer@...gutronix.de>, Linus Walleij
<linus.walleij@...aro.org>, Bartosz Golaszewski <brgl@...ev.pl>, Pengutronix
Kernel Team <kernel@...gutronix.de>, Fabio Estevam <festevam@...il.com>, Peng
Fan <peng.fan@....com>, "linux-remoteproc@...r.kernel.org"
<linux-remoteproc@...r.kernel.org>, "devicetree@...r.kernel.org"
<devicetree@...r.kernel.org>, "imx@...ts.linux.dev" <imx@...ts.linux.dev>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, dl-linux-imx <linux-imx@....com>
Subject: RE: [PATCH v2 2/4] remoteproc: imx_rproc: Populate devices under
"rpmsg" subnode
Hi Peng,
> -----Original Message-----
> From: Peng Fan (OSS) <peng.fan@....nxp.com>
> Sent: Sunday, September 28, 2025 3:48 AM
> To: Shenwei Wang <shenwei.wang@....com>
> Cc: Bjorn Andersson <andersson@...nel.org>; Mathieu Poirier
> <mathieu.poirier@...aro.org>; Rob Herring <robh@...nel.org>; Krzysztof
> Kozlowski <krzk+dt@...nel.org>; Conor Dooley <conor+dt@...nel.org>; Shawn
> Guo <shawnguo@...nel.org>; Sascha Hauer <s.hauer@...gutronix.de>; Linus
> Walleij <linus.walleij@...aro.org>; Bartosz Golaszewski <brgl@...ev.pl>;
> Pengutronix Kernel Team <kernel@...gutronix.de>; Fabio Estevam
> <festevam@...il.com>; Peng Fan <peng.fan@....com>; linux-
> remoteproc@...r.kernel.org; devicetree@...r.kernel.org; imx@...ts.linux.dev;
> >+
> >+ drvdata->rpdev = rpdev;
> >+ auxdata[0].compatible = channel_device_map[i][1];
> >+ auxdata[0].platform_data = drvdata;
> >+ dev_set_drvdata(dev, drvdata);
> >+
> >+ of_platform_populate(drvdata->channel_node, NULL, auxdata, dev);
> >+ of_node_put(drvdata->channel_node);
>
> of_platform_populate will decrement the reference to drvdata->channel_node
> before it return. I not see other places increment the reference to channel_node,
> of_node_put here could be removed.
>
The of_node_put is to balance the reference counter which is increased by of_get_child_by_name in imx_of_rpmsg_node_init function.
+static int imx_of_rpmsg_node_init(struct platform_device *pdev)
+{
...
+ for (i = 0; i < count; i++) {
+ ret = -ENOMEM;
+ channel = of_get_child_by_name(np, channel_device_map[i][0]);
Thanks,
Shenwei
> >+
> >+ return 0;
> >+}
> >+
> >+static int imx_of_rpmsg_node_init(struct platform_device *pdev) {
> >+ struct device_node *np __free(device_node), *channel;
> >+ struct imx_rpmsg_driver_data *driver_data;
> >+ struct imx_rpmsg_driver *rp_driver;
> >+ struct rpmsg_device_id *rpdev_id;
> >+ int i, ret;
> >+
> >+ int count = ARRAY_SIZE(channel_device_map);
> >+ struct device *dev = &pdev->dev;
> >+
Powered by blists - more mailing lists