[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0bf101db25a8$9fe17d10$dfa47730$@samsung.com>
Date: Thu, 24 Oct 2024 09:06:49 +0900
From: "Jaehoon Chung" <jh80.chung@...sung.com>
To: "'Tim Harvey'" <tharvey@...eworks.com>, "'Heiko Schocher'" <hs@...x.de>,
"'Tom Rini'" <trini@...sulko.com>, "'Peng Fan'" <peng.fan@....com>,
<u-boot@...ts.denx.de>
Cc: <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 4/4] mmc: fsl_esdhc: Convert to use livetree API for fdt
access
> -----Original Message-----
> From: Tim Harvey <tharvey@...eworks.com>
> Sent: Thursday, October 24, 2024 5:29 AM
> To: Heiko Schocher <hs@...x.de>; Tom Rini <trini@...sulko.com>; Peng Fan <peng.fan@....com>; Jaehoon
> Chung <jh80.chung@...sung.com>; u-boot@...ts.denx.de
> Cc: linux-kernel@...r.kernel.org; Tim Harvey <tharvey@...eworks.com>
> Subject: [PATCH 4/4] mmc: fsl_esdhc: Convert to use livetree API for fdt access
>
> Convert to using livetree API functions.
>
> Without this if livetree is enabled (OF_LIVE) the fsl_esdhc_imx
> driver will fail to read vendor-specific properties from the dt.
>
> Signed-off-by: Tim Harvey <tharvey@...eworks.com>
Reviewed-by: Jaehoon Chung <jh80.chung@...sung.com>
Best Regards,
Jaehoon Chung
> ---
> drivers/mmc/fsl_esdhc_imx.c | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
> index fb410104c1fc..d7a45ef0ad0d 100644
> --- a/drivers/mmc/fsl_esdhc_imx.c
> +++ b/drivers/mmc/fsl_esdhc_imx.c
> @@ -1398,8 +1398,7 @@ static int fsl_esdhc_of_to_plat(struct udevice *dev)
> struct udevice *vqmmc_dev;
> int ret;
>
> - const void *fdt = gd->fdt_blob;
> - int node = dev_of_offset(dev);
> + ofnode node = dev_ofnode(dev);
> fdt_addr_t addr;
> unsigned int val;
>
> @@ -1413,15 +1412,15 @@ static int fsl_esdhc_of_to_plat(struct udevice *dev)
> priv->dev = dev;
> priv->mode = -1;
>
> - val = fdtdec_get_int(fdt, node, "fsl,tuning-step", 1);
> + val = ofnode_read_u32_default(node, "fsl,tuning-step", 1);
> priv->tuning_step = val;
> - val = fdtdec_get_int(fdt, node, "fsl,tuning-start-tap",
> - ESDHC_TUNING_START_TAP_DEFAULT);
> + val = ofnode_read_u32_default(node, "fsl,tuning-start-tap",
> + ESDHC_TUNING_START_TAP_DEFAULT);
> priv->tuning_start_tap = val;
> - val = fdtdec_get_int(fdt, node, "fsl,strobe-dll-delay-target",
> - ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET_DEFAULT);
> + val = ofnode_read_u32_default(node, "fsl,strobe-dll-delay-target",
> + ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET_DEFAULT);
> priv->strobe_dll_delay_target = val;
> - val = fdtdec_get_int(fdt, node, "fsl,signal-voltage-switch-extra-delay-ms", 0);
> + val = ofnode_read_u32_default(node, "fsl,signal-voltage-switch-extra-delay-ms", 0);
> priv->signal_voltage_switch_extra_delay_ms = val;
>
> if (dev_read_bool(dev, "broken-cd"))
> --
> 2.25.1
>
Powered by blists - more mailing lists