提交 d773a008 编写于 作者: S Simon Glass 提交者: Tom Rini

spl: mmc: Fix compiler warning with CONFIG_DM_MMC

Since commit 4188ba32 we get the following warning on rockchip boards:

common/spl/spl_mmc.c:31:24: warning: ‘mmc’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  count = mmc->block_dev.block_read(0, sector, 1, header);
                        ^
common/spl/spl_mmc.c:251:14: note: ‘mmc’ was declared here
  struct mmc *mmc;

Correct this by move the variable init earlier.
Signed-off-by: NSimon Glass <sjg@chromium.org>
Tested-by: NMichal Simek <michal.simek@xilinx.com>
Acked-by: NNikita Kiryanov <nikita@compulab.co.il>
上级 9cb05a8f
......@@ -248,7 +248,7 @@ int spl_mmc_do_fs_boot(struct mmc *mmc)
int spl_mmc_load_image(u32 boot_device)
{
struct mmc *mmc;
struct mmc *mmc = NULL;
u32 boot_mode;
int err = 0;
__maybe_unused int part;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册