Skip to contentSkip to conversation

mmc: dw-mmc: modify the condition for platdata of blk-setting

PATCH In review Jaehoon Chung 3 participants 3 messages Jan 16, 2012 – Feb 4, 2012

Subsystems (2)
lore
Share & tools
lore

Jaehoon Chung

author maintainer
#0 lore raw

PATCH 1/1 mmc: dw-mmc: modify the condition for platdata of blk-setting

When use the IDMAC, we can also want to use the pdata->blk-setting. So if pdata->blk-setting is unset, use the default value. if not, use the pdata->blk-setting.

---
 drivers/mmc/host/dw_mmc.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
drivers/mmc/host/dw_mmc.c +8 -8
index 0e34279..d458aaa 100644
@@ -1714,13 +1714,6 @@ static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 	if (host->pdata->quirks & DW_MCI_QUIRK_HIGHSPEED)
 		mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
 
-#ifdef CONFIG_MMC_DW_IDMAC
-	mmc->max_segs = host->ring_size;
-	mmc->max_blk_size = 65536;
-	mmc->max_blk_count = host->ring_size;
-	mmc->max_seg_size = 0x1000;
-	mmc->max_req_size = mmc->max_seg_size * mmc->max_blk_count;
-#else
 	if (host->pdata->blk_settings) {
 		mmc->max_segs = host->pdata->blk_settings->max_segs;
 		mmc->max_blk_size = host->pdata->blk_settings->max_blk_size;
@@ -1729,13 +1722,20 @@ static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 		mmc->max_seg_size = host->pdata->blk_settings->max_seg_size;
 	} else {
 		/* Useful defaults if platform data is unset. */
+#ifdef CONFIG_MMC_DW_IDMAC
+		mmc->max_segs = host->ring_size;
+		mmc->max_blk_size = 65536;
+		mmc->max_blk_count = host->ring_size;
+		mmc->max_seg_size = 0x1000;
+		mmc->max_req_size = mmc->max_seg_size * mmc->max_blk_count;
+#else
 		mmc->max_segs = 64;
 		mmc->max_blk_size = 65536; /* BLKSIZ is 16 bits */
 		mmc->max_blk_count = 512;
 		mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
 		mmc->max_seg_size = mmc->max_req_size;
-	}
 #endif /* CONFIG_MMC_DW_IDMAC */
+	}
 
 	host->vmmc = regulator_get(mmc_dev(mmc), "vmmc");
 	if (IS_ERR(host->vmmc)) {
Signature · 1 line
1.7.4.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Jaehoon Chung

When use the IDMAC, we can also want to use the pdata->blk-setting. So if pdata->blk-setting is unset, use the default value. if not, use the pdata->blk-setting.

---
 drivers/mmc/host/dw_mmc.c |   16 ++++++++--------

 1 files changed, 8 insertions(+), 8 deletions(-)

Looks good.

#2 lore raw

Hi,

Quoted 11 lines · Will Newton
Quoted 9 lines · Jaehoon Chung

When use the IDMAC, we can also want to use the pdata->blk-setting. So if pdata->blk-setting is unset, use the default value. if not, use the pdata->blk-setting.

---
 drivers/mmc/host/dw_mmc.c |   16 ++++++++--------

 1 files changed, 8 insertions(+), 8 deletions(-)
Quoted 3 lines

Looks good.

Thanks, pushed to mmc-next for 3.4.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child