[PATCH 1/1] dm: core: revert "Don't inline dev_read...() calls with of-platdata"

Simon Glass sjg at chromium.org
Tue Feb 21 20:35:43 CET 2023


Hi Heinrich,

On Sat, 18 Feb 2023 at 02:17, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> Compiling sandbox_defconfig with CONFIG_SPL_MMC=y results in
>
>     drivers/mmc/mmc-uclass.c:211:
>     undefined reference to `dev_read_u32_default'
>
> Revert the fraudulent patch.
>
> Fixes: ef79ef21a852 ("dm: core: Don't inline dev_read...() calls with of-platdata")
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
>  include/dm/read.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

NAK, sorry

You cannot call mmc_of_parse() when OF_REAL is not enabled, since
there is no actual devicetree. This is the case with sandbox_spl,
since it uses o-platdata.

The original patch is actually correct.

The real fix is to implement of-platdata in drivers/mmc/sandbox_mmc.c
as has been done in rockchip_dw_mmc.c for example. See also:

https://u-boot.readthedocs.io/en/latest/develop/driver-model/of-plat.html

Regards,
SImon


>
> diff --git a/include/dm/read.h b/include/dm/read.h
> index 56ac076c9f..ca1c60e079 100644
> --- a/include/dm/read.h
> +++ b/include/dm/read.h
> @@ -30,7 +30,7 @@ static inline const struct device_node *dev_np(const struct udevice *dev)
>  }
>  #endif
>
> -#if !defined(CONFIG_DM_DEV_READ_INLINE) || CONFIG_IS_ENABLED(OF_PLATDATA)
> +#ifndef CONFIG_DM_DEV_READ_INLINE
>  /**
>   * dev_read_u8() - read a 8-bit integer from a device's DT property
>   *
> --
> 2.38.1
>


More information about the U-Boot mailing list