summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/mmc_legacy.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/mmc/mmc_legacy.c b/drivers/mmc/mmc_legacy.c
index 040728b45d..25361d10f6 100644
--- a/drivers/mmc/mmc_legacy.c
+++ b/drivers/mmc/mmc_legacy.c
@@ -115,10 +115,15 @@ struct mmc *mmc_create(const struct mmc_config *cfg, void *priv)
struct mmc *mmc;
/* quick validation */
- if (cfg == NULL || cfg->ops == NULL || cfg->ops->send_cmd == NULL ||
- cfg->f_min == 0 || cfg->f_max == 0 || cfg->b_max == 0)
+ if (cfg == NULL || cfg->f_min == 0 ||
+ cfg->f_max == 0 || cfg->b_max == 0)
return NULL;
+#ifndef CONFIG_DM_MMC_OPS
+ if (cfg->ops == NULL || cfg->ops->send_cmd == NULL)
+ return NULL;
+#endif
+
mmc = calloc(1, sizeof(*mmc));
if (mmc == NULL)
return NULL;