[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230327030213.GJ3364759@dragon>
Date: Mon, 27 Mar 2023 11:02:13 +0800
From: Shawn Guo <shawnguo@...nel.org>
To: Geert Uytterhoeven <geert+renesas@...der.be>,
Ivan Bornyakov <i.bornyakov@...rotek.ru>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Saravana Kannan <saravanak@...gle.com>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
Wolfram Sang <wsa@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Frank Rowand <frowand.list@...il.com>,
Mark Brown <broonie@...nel.org>,
linux-arm-kernel@...ts.infradead.org, linux-i2c@...r.kernel.org,
devicetree@...r.kernel.org, linux-spi@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] treewide: Fix instantiation of devices in DT overlays
+ Ivan
On Fri, Mar 24, 2023 at 10:30:39AM +0100, Geert Uytterhoeven wrote:
> When loading a DT overlay that creates a device, the device is not
> instantiated, unless the DT overlay is unloaded and reloaded again.
>
> Saravana explains:
> Basically for all overlays (I hope the function is only used for
> overlays) we assume all nodes are NOT devices until they actually
> get added as a device.
>
> Based on a patch by Saravana Kannan, which covered only platform and spi
> devices.
>
> Fixes: 4a032827daa89350 ("of: property: Simplify of_link_to_phandle()")
> Link: https://lore.kernel.org/r/CAGETcx_+rhHvaC_HJXGrr5_WAd2+k5f=rWYnkCZ6z5bGX-wj4w@mail.gmail.com
> Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
> Acked-by: Mark Brown <broonie@...nel.org>
> ---
> v2:
> - Add Acked-by,
> - Drop RFC.
> ---
> drivers/bus/imx-weim.c | 1 +
> drivers/i2c/i2c-core-of.c | 1 +
> drivers/of/dynamic.c | 1 +
> drivers/of/platform.c | 1 +
> drivers/spi/spi.c | 1 +
> 5 files changed, 5 insertions(+)
>
> diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
> index 36d42484142aede2..898e23a4231400fa 100644
> --- a/drivers/bus/imx-weim.c
> +++ b/drivers/bus/imx-weim.c
> @@ -329,6 +329,7 @@ static int of_weim_notify(struct notifier_block *nb, unsigned long action,
> "Failed to setup timing for '%pOF'\n", rd->dn);
>
> if (!of_node_check_flag(rd->dn, OF_POPULATED)) {
> + rd->dn->fwnode.flags &= ~FWNODE_FLAG_NOT_DEVICE;
> if (!of_platform_device_create(rd->dn, NULL, &pdev->dev)) {
> dev_err(&pdev->dev,
> "Failed to create child device '%pOF'\n",
Ivan, so you were aware of that the device is not instantiated before
this change?
Shawn
Powered by blists - more mailing lists