mmc: fix the build error when MMC_WRITE is disabled
authorJaehoon Chung <jh80.chung@samsung.com>
Fri, 17 Jan 2020 06:06:54 +0000 (15:06 +0900)
committerPeng Fan <peng.fan@nxp.com>
Mon, 17 Feb 2020 06:55:04 +0000 (14:55 +0800)
erase_grp_size is used, when MMC_WRITE is enabled.
- error: ‘struct mmc’ has no member named ‘erase_grp_size’

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
drivers/mmc/mmc.c

index d43983d..6a2b855 100644 (file)
@@ -1126,9 +1126,11 @@ int mmc_hwpart_config(struct mmc *mmc,
 
                ext_csd[EXT_CSD_ERASE_GROUP_DEF] = 1;
 
+#if CONFIG_IS_ENABLED(MMC_WRITE)
                /* update erase group size to be high-capacity */
                mmc->erase_grp_size =
                        ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE] * 1024;
+#endif
 
        }