mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] reset: rzg2l-usbphy-ctrl: Assign proper of node to the allocated device
@ 2024-11-19  8:55 Claudiu
  2024-11-19  9:06 ` Biju Das
  2024-12-06 15:55 ` Philipp Zabel
  0 siblings, 2 replies; 3+ messages in thread
From: Claudiu @ 2024-11-19  8:55 UTC (permalink / raw)
  To: p.zabel, broonie, biju.das.jz
  Cc: linux-kernel, jbrunet, claudiu.beznea, Claudiu Beznea

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

The platform device named "rzg2l-usb-vbus-regulator", allocated by
the rzg2l-usbphy-ctrl driver, is used to instantiate a regulator driver.
This regulator driver is associated with a device tree (DT) node, which
is a child of the rzg2l-usbphy-ctrl DT node. The regulator's DT node allows
consumer nodes to reference the regulator and configure the regulator as
needed.

Starting with commit cd7a38c40b23 ("regulator: core: do not silently ignore
provided init_data") the struct regulator_dev::dev::of_node is no longer
populated using of_node_get(config->of_node) if the regulator does not
provide init_data. Since the rzg2l-usb-vbus-regulator does not provide
init_data, this behaviour causes the of_find_regulator_by_node() function
to fails, resulting in errors when attempting to request the regulator.

To fix this issue, call device_set_of_node_from_dev() for the
"rzg2l-usb-vbus-regulator" platform device.

Fixes: 84fbd6198766 ("regulator: Add Renesas RZ/G2L USB VBUS regulator driver")
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/reset/reset-rzg2l-usbphy-ctrl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/reset/reset-rzg2l-usbphy-ctrl.c b/drivers/reset/reset-rzg2l-usbphy-ctrl.c
index 1cd157f4f03b..4e2ac1f0060c 100644
--- a/drivers/reset/reset-rzg2l-usbphy-ctrl.c
+++ b/drivers/reset/reset-rzg2l-usbphy-ctrl.c
@@ -176,6 +176,7 @@ static int rzg2l_usbphy_ctrl_probe(struct platform_device *pdev)
 	vdev->dev.parent = dev;
 	priv->vdev = vdev;
 
+	device_set_of_node_from_dev(&vdev->dev, dev);
 	error = platform_device_add(vdev);
 	if (error)
 		goto err_device_put;
-- 
2.39.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] reset: rzg2l-usbphy-ctrl: Assign proper of node to the allocated device
  2024-11-19  8:55 [PATCH] reset: rzg2l-usbphy-ctrl: Assign proper of node to the allocated device Claudiu
@ 2024-11-19  9:06 ` Biju Das
  2024-12-06 15:55 ` Philipp Zabel
  1 sibling, 0 replies; 3+ messages in thread
From: Biju Das @ 2024-11-19  9:06 UTC (permalink / raw)
  To: Claudiu.Beznea, p.zabel, broonie
  Cc: linux-kernel, jbrunet, Claudiu.Beznea, Claudiu Beznea

Hi Claudiu,

Thanks for the patch.

> -----Original Message-----
> From: Claudiu <claudiu.beznea@tuxon.dev>
> Sent: 19 November 2024 08:56
> Subject: [PATCH] reset: rzg2l-usbphy-ctrl: Assign proper of node to the allocated device
> 
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> 
> The platform device named "rzg2l-usb-vbus-regulator", allocated by the rzg2l-usbphy-ctrl driver, is
> used to instantiate a regulator driver.
> This regulator driver is associated with a device tree (DT) node, which is a child of the rzg2l-
> usbphy-ctrl DT node. The regulator's DT node allows consumer nodes to reference the regulator and
> configure the regulator as needed.
> 
> Starting with commit cd7a38c40b23 ("regulator: core: do not silently ignore provided init_data") the
> struct regulator_dev::dev::of_node is no longer populated using of_node_get(config->of_node) if the
> regulator does not provide init_data. Since the rzg2l-usb-vbus-regulator does not provide init_data,
> this behaviour causes the of_find_regulator_by_node() function to fails, resulting in errors when
> attempting to request the regulator.
> 
> To fix this issue, call device_set_of_node_from_dev() for the "rzg2l-usb-vbus-regulator" platform
> device.
> 
> Fixes: 84fbd6198766 ("regulator: Add Renesas RZ/G2L USB VBUS regulator driver")
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>

Cheers,
Biju

> ---
>  drivers/reset/reset-rzg2l-usbphy-ctrl.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/reset/reset-rzg2l-usbphy-ctrl.c b/drivers/reset/reset-rzg2l-usbphy-ctrl.c
> index 1cd157f4f03b..4e2ac1f0060c 100644
> --- a/drivers/reset/reset-rzg2l-usbphy-ctrl.c
> +++ b/drivers/reset/reset-rzg2l-usbphy-ctrl.c
> @@ -176,6 +176,7 @@ static int rzg2l_usbphy_ctrl_probe(struct platform_device *pdev)
>  	vdev->dev.parent = dev;
>  	priv->vdev = vdev;
> 
> +	device_set_of_node_from_dev(&vdev->dev, dev);
>  	error = platform_device_add(vdev);
>  	if (error)
>  		goto err_device_put;
> --
> 2.39.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] reset: rzg2l-usbphy-ctrl: Assign proper of node to the allocated device
  2024-11-19  8:55 [PATCH] reset: rzg2l-usbphy-ctrl: Assign proper of node to the allocated device Claudiu
  2024-11-19  9:06 ` Biju Das
@ 2024-12-06 15:55 ` Philipp Zabel
  1 sibling, 0 replies; 3+ messages in thread
From: Philipp Zabel @ 2024-12-06 15:55 UTC (permalink / raw)
  To: Claudiu, broonie, biju.das.jz; +Cc: linux-kernel, jbrunet, Claudiu Beznea

On Di, 2024-11-19 at 10:55 +0200, Claudiu wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> 
> The platform device named "rzg2l-usb-vbus-regulator", allocated by
> the rzg2l-usbphy-ctrl driver, is used to instantiate a regulator driver.
> This regulator driver is associated with a device tree (DT) node, which
> is a child of the rzg2l-usbphy-ctrl DT node. The regulator's DT node allows
> consumer nodes to reference the regulator and configure the regulator as
> needed.
[...]

Applied to reset/fixes, thanks!

[1/1] reset: rzg2l-usbphy-ctrl: Assign proper of node to the allocated device
      https://git.pengutronix.de/cgit/pza/linux/commit/?id=1f8af9712413

regards
Philipp

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-12-06 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-19  8:55 [PATCH] reset: rzg2l-usbphy-ctrl: Assign proper of node to the allocated device Claudiu
2024-11-19  9:06 ` Biju Das
2024-12-06 15:55 ` Philipp Zabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®