diff mbox series

mmc: fix the build error when MMC_WRITE is disabled

Message ID 20200117060654.18351-1-jh80.chung@samsung.com
State Accepted
Commit 4af6659605abd707da3acc9ea525514e999b7aef
Headers show
Series mmc: fix the build error when MMC_WRITE is disabled | expand

Commit Message

Jaehoon Chung Jan. 17, 2020, 6:06 a.m. UTC
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 at samsung.com>
---
 drivers/mmc/mmc.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Peng Fan Jan. 17, 2020, 7:57 a.m. UTC | #1
> Subject: [PATCH] mmc: fix the build error when MMC_WRITE is disabled
> 
> 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 at samsung.com>

Reviewed-by: Peng Fan <peng.fan at nxp.com>

Regards,
Peng.

> ---
>  drivers/mmc/mmc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index
> d43983d4a6..6a2b855435 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -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
> 
>  	}
> 
> --
> 2.24.1
diff mbox series

Patch

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index d43983d4a6..6a2b855435 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -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
 
 	}