diff options
author | Simon Glass <sjg@chromium.org> | 2017-04-23 20:02:09 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2017-06-01 07:03:05 -0600 |
commit | 66656020ff180e2a689fbe83fcd02c3e42ecdc30 (patch) | |
tree | 51f724bc32e317e4df0e43db33e0065b5bd6875c /drivers | |
parent | e48eeb9ea3aed67e4bda94c65a7f13e8672a3501 (diff) | |
download | u-boot-66656020ff180e2a689fbe83fcd02c3e42ecdc30.zip u-boot-66656020ff180e2a689fbe83fcd02c3e42ecdc30.tar.gz u-boot-66656020ff180e2a689fbe83fcd02c3e42ecdc30.tar.bz2 |
dm: mmc: Check that drivers have operations
When binding a new MMC device, make sure that it has the required
operations. Since for now we still support *not* having the operations
(with CONFIG_DM_MMC_OPS not enabled) it makes sense to add this check.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/mmc-uclass.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index 8d03ec6..c9b6364 100644 --- a/drivers/mmc/mmc-uclass.c +++ b/drivers/mmc/mmc-uclass.c @@ -196,6 +196,10 @@ int mmc_bind(struct udevice *dev, struct mmc *mmc, const struct mmc_config *cfg) struct udevice *bdev; int ret, devnum = -1; +#ifdef CONFIG_DM_MMC_OPS + if (!mmc_get_ops(dev)) + return -ENOSYS; +#endif #ifndef CONFIG_SPL_BUILD /* Use the fixed index with aliase node's index */ fdtdec_get_alias_seq(gd->fdt_blob, "mmc", dev_of_offset(dev), &devnum); |