static const char *init_mmc_for_env(struct mmc *mmc) { if (!mmc) return "!No MMC card found"; if (mmc_init(mmc)) return "!MMC init failed"; if (mmc_set_env_part(mmc)) return "!MMC partition switch failed"; return NULL; }
static const char *init_mmc_for_env(struct mmc *mmc) { if (!mmc) return "!No MMC card found"; #ifdef CONFIG_BLK struct udevice *dev; if (blk_get_from_parent(mmc->dev, &dev)) return "!No block device"; #else if (mmc_init(mmc)) return "!MMC init failed"; #endif if (mmc_set_env_part(mmc)) return "!MMC partition switch failed"; return NULL; }