Skip to contentSkip to conversation

mmc: dw_mmc: Add second capability field

PATCH In review Seungwon Jeon 3 participants 3 messages Dec 22, 2011 – Dec 25, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mmc: dw_mmc: Add second capability field

This patch adds caps2 filed for second capability in dw_mmc. It corresponds with MMC_CAPS2_XXX. And this patch removes the unnecessary condition statement for assigning caps.

---
 drivers/mmc/host/dw_mmc.c  |    6 ++----
 include/linux/mmc/dw_mmc.h |    1 +
 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/mmc/host/dw_mmc.c +2 -4
index 3aaeb08..3f5a77a 100644
@@ -1676,10 +1676,8 @@ static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 	if (host->pdata->setpower)
 		host->pdata->setpower(id, 0);
 
-	if (host->pdata->caps)
-		mmc->caps = host->pdata->caps;
-	else
-		mmc->caps = 0;
+	mmc->caps |= host->pdata->caps;
+	mmc->caps2 |= host->pdata->caps2;
 
 	if (host->pdata->get_bus_wd)
 		if (host->pdata->get_bus_wd(slot->id) >= 4)
include/linux/mmc/dw_mmc.h +1 -0
index 6dc9b80..e8779c6 100644
@@ -214,6 +214,7 @@ struct dw_mci_board {
 	unsigned int bus_hz; /* Bus speed */
 
 	unsigned int caps;	/* Capabilities */
+	unsigned int caps2;	/* More capabilities */
 	/*
 	 * Override fifo depth. If 0, autodetect it from the FIFOTH register,
 	 * but note that this may not be reliable after a bootloader has used
Signature · 1 line
1.7.0.4
Acked-by on v2 1/1
#1 lore raw
Quoted 9 lines · Seungwon Jeon

This patch adds caps2 filed for second capability in dw_mmc. It corresponds with MMC_CAPS2_XXX. And this patch removes the unnecessary condition statement for assigning caps.

---
 drivers/mmc/host/dw_mmc.c  |    6 ++----
 include/linux/mmc/dw_mmc.h |    1 +

 2 files changed, 3 insertions(+), 4 deletions(-)
#2 lore raw
In reply to Seungwon Jeon

Hi,

Quoted 15 lines · Seungwon Jeon

This patch adds caps2 filed for second capability in dw_mmc. It corresponds with MMC_CAPS2_XXX. And this patch removes the unnecessary condition statement for assigning caps.

---
 drivers/mmc/host/dw_mmc.c  |    6 ++----
 include/linux/mmc/dw_mmc.h |    1 +
 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/mmc/host/dw_mmc.c +0 -0
index 3aaeb08..3f5a77a 100644

drivers/mmc/host/dw_mmc.c static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id) · line 1680

Quoted 9 lines
drivers/mmc/host/dw_mmc.c +2 -4
@@ -1676,10 +1676,8 @@ static int __init dw_mci_init_slot(struct dw_mci *host, unsigned int id)
 	if (host->pdata->setpower)
 		host->pdata->setpower(id, 0);
 
-	if (host->pdata->caps)
-		mmc->caps = host->pdata->caps;
-	else
-		mmc->caps = 0;
+	mmc->caps |= host->pdata->caps;
+	mmc->caps2 |= host->pdata->caps2;

Ah, I replied earlier without having seen this patch. I still prefer the version I proposed, which doesn't dereference host->pdata->caps{,2} without testing it first.

- Chris.

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