提交 d48b8d11 编写于 作者: S Sjoerd Simons 提交者: Tom Rini

env: Properly check for BLK support

Use CONFIG_IS_ENABLED to see if CONFIG_BLK is enabled. Otherwise
SPL compilation breaks on boards which do have CONFIG_BLK enabled but
not DM_MMC for the SPL as follows:

env/mmc.c: In function ‘init_mmc_for_env’:
env/mmc.c:164:6: warning: implicit declaration of function ‘blk_get_from_parent’; did you mean ‘efi_get_ram_base’? [-Wimplicit-function-declaration]
  if (blk_get_from_parent(mmc->dev, &dev))
      ^~~~~~~~~~~~~~~~~~~
      efi_get_ram_base
env/mmc.c:164:29: error: ‘struct mmc’ has no member named ‘dev’
  if (blk_get_from_parent(mmc->dev, &dev))
                             ^~
Signed-off-by: NSjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: NSimon Glass <sjg@chromium.org>
上级 4abd9cec
......@@ -158,7 +158,7 @@ static const char *init_mmc_for_env(struct mmc *mmc)
if (!mmc)
return "!No MMC card found";
#ifdef CONFIG_BLK
#if CONFIG_IS_ENABLED(BLK)
struct udevice *dev;
if (blk_get_from_parent(mmc->dev, &dev))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册