[PATCH 6.1.y-cip 12/17] mmc: renesas_sdhi: Use of_get_available_child_by_name()

Tommaso Merciai
2025-06-23T14:47:42Z

From: Biju Das <biju.das.jz@bp.renesas.com>

commit 18da3ecdbaf6f140eb45818fd848b85d2c414db6 upstream.

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>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250407092144.35268-1-biju.das.jz@bp.renesas.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@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 cb089997e4bb..725bd37b8c21 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -1164,12 +1164,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