Linux MultiMedia Card development
 help / color / mirror / Atom feed
* [PATCH] mmc: renesas_sdhi: Use of_get_available_child_by_name()
@ 2025-04-07  9:21 Biju Das
  2025-04-07  9:37 ` Wolfram Sang
  2025-04-09 13:13 ` Ulf Hansson
  0 siblings, 2 replies; 4+ messages in thread
From: Biju Das @ 2025-04-07  9:21 UTC (permalink / raw)
  To: Wolfram Sang, Ulf Hansson
  Cc: Biju Das, linux-mmc, linux-renesas-soc, Geert Uytterhoeven,
	Prabhakar Mahadev Lad, Biju Das

Use the helper of_get_available_child_by_name() to simplify
renesas_sdhi_probe().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/mmc/host/renesas_sdhi_core.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index fa6526be3638..e26e7995754e 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -1166,12 +1166,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
 	if (ret)
 		goto efree;
 
-	rcfg.of_node = of_get_child_by_name(dev->of_node, "vqmmc-regulator");
-	if (!of_device_is_available(rcfg.of_node)) {
-		of_node_put(rcfg.of_node);
-		rcfg.of_node = NULL;
-	}
-
+	rcfg.of_node = of_get_available_child_by_name(dev->of_node, "vqmmc-regulator");
 	if (rcfg.of_node) {
 		rcfg.driver_data = priv->host;
 		rdev = devm_regulator_register(dev, &renesas_sdhi_vqmmc_regulator, &rcfg);
-- 
2.43.0


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

* Re: [PATCH] mmc: renesas_sdhi: Use of_get_available_child_by_name()
  2025-04-07  9:21 [PATCH] mmc: renesas_sdhi: Use of_get_available_child_by_name() Biju Das
@ 2025-04-07  9:37 ` Wolfram Sang
  2025-04-07  9:45   ` Wolfram Sang
  2025-04-09 13:13 ` Ulf Hansson
  1 sibling, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2025-04-07  9:37 UTC (permalink / raw)
  To: Biju Das
  Cc: Ulf Hansson, linux-mmc, linux-renesas-soc, Geert Uytterhoeven,
	Prabhakar Mahadev Lad, Biju Das

[-- Attachment #1: Type: text/plain, Size: 281 bytes --]

On Mon, Apr 07, 2025 at 10:21:41AM +0100, Biju Das wrote:
> Use the helper of_get_available_child_by_name() to simplify
> renesas_sdhi_probe().
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Yay!

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] mmc: renesas_sdhi: Use of_get_available_child_by_name()
  2025-04-07  9:37 ` Wolfram Sang
@ 2025-04-07  9:45   ` Wolfram Sang
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2025-04-07  9:45 UTC (permalink / raw)
  To: Biju Das, Ulf Hansson, linux-mmc, linux-renesas-soc,
	Geert Uytterhoeven, Prabhakar Mahadev Lad, Biju Das

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

On Mon, Apr 07, 2025 at 11:37:43AM +0200, Wolfram Sang wrote:
> On Mon, Apr 07, 2025 at 10:21:41AM +0100, Biju Das wrote:
> > Use the helper of_get_available_child_by_name() to simplify
> > renesas_sdhi_probe().
> > 
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> 
> Yay!
> 
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

And FWIW, tested with RZ/G3S which does not have the internal
regulators. Still boots and works fine:

Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] mmc: renesas_sdhi: Use of_get_available_child_by_name()
  2025-04-07  9:21 [PATCH] mmc: renesas_sdhi: Use of_get_available_child_by_name() Biju Das
  2025-04-07  9:37 ` Wolfram Sang
@ 2025-04-09 13:13 ` Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2025-04-09 13:13 UTC (permalink / raw)
  To: Biju Das
  Cc: Wolfram Sang, linux-mmc, linux-renesas-soc, Geert Uytterhoeven,
	Prabhakar Mahadev Lad, Biju Das

On Mon, 7 Apr 2025 at 11:21, Biju Das <biju.das.jz@bp.renesas.com> wrote:
>
> Use the helper of_get_available_child_by_name() to simplify
> renesas_sdhi_probe().
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/renesas_sdhi_core.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> index fa6526be3638..e26e7995754e 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -1166,12 +1166,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
>         if (ret)
>                 goto efree;
>
> -       rcfg.of_node = of_get_child_by_name(dev->of_node, "vqmmc-regulator");
> -       if (!of_device_is_available(rcfg.of_node)) {
> -               of_node_put(rcfg.of_node);
> -               rcfg.of_node = NULL;
> -       }
> -
> +       rcfg.of_node = of_get_available_child_by_name(dev->of_node, "vqmmc-regulator");
>         if (rcfg.of_node) {
>                 rcfg.driver_data = priv->host;
>                 rdev = devm_regulator_register(dev, &renesas_sdhi_vqmmc_regulator, &rcfg);
> --
> 2.43.0
>

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

end of thread, other threads:[~2025-04-09 13:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-07  9:21 [PATCH] mmc: renesas_sdhi: Use of_get_available_child_by_name() Biju Das
2025-04-07  9:37 ` Wolfram Sang
2025-04-07  9:45   ` Wolfram Sang
2025-04-09 13:13 ` Ulf Hansson

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