]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/mmc/mmc.c
mmc: Protect `mmc_initialize` from initialising mmc multiple times
[karo-tx-uboot.git] / drivers / mmc / mmc.c
index 76095f1aa3fce297242e88020328b4b407eb8971..c29f40db5f2d12fa9a504171ecdbd6aa8663d17b 100644 (file)
@@ -1766,6 +1766,11 @@ static void do_preinit(void)
 
 int mmc_initialize(bd_t *bis)
 {
+       static int initialized = 0;
+       if (initialized)        /* Avoid initializing mmc multiple times */
+               return 0;
+       initialized = 1;
+
        INIT_LIST_HEAD (&mmc_devices);
        cur_dev_num = 0;