提交 d66fb5b1 编写于 作者: E Ezequiel Garcia 提交者: Tom Rini

mmc: Register only the first MMC device on MMC_TINY

When MMC_TINY is enabled, support for only one MMC device
is provided. Boards that register more than one device,
will just write over mmc_static keeping only the last one
registered.

This commit prevents this, keeping only the first MMC
device created. A debug warning message is added, if nothing
else, as a hint/documentation for developers.
Signed-off-by: NEzequiel Garcia <ezequiel@collabora.com>
上级 bf7c01d9
......@@ -150,6 +150,15 @@ struct mmc *mmc_create(const struct mmc_config *cfg, void *priv)
{
struct mmc *mmc = &mmc_static;
/* First MMC device registered, fail to register a new one.
* Given users are not expecting this to fail, instead
* of failing let's just return the only MMC device
*/
if (mmc->cfg) {
debug("Warning: MMC_TINY doesn't support multiple MMC devices\n");
return mmc;
}
mmc->cfg = cfg;
mmc->priv = priv;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册