diff mbox

[U-Boot] mmc: dw_mmc: remove the unnecessary arguments for dwmci_setup_cfg

Message ID 1474625596-6043-1-git-send-email-jh80.chung@samsung.com
State Accepted
Commit e5113c333b318328619f8cf2d9984f05fc5c3b59
Delegated to: Jaehoon Chung
Headers show

Commit Message

Jaehoon Chung Sept. 23, 2016, 10:13 a.m. UTC
Some arguments don't need to pass to dwmci_setup_cfg.
They are already included in dwmci_host structure.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
 drivers/mmc/dw_mmc.c          | 13 ++++++-------
 drivers/mmc/exynos_dw_mmc.c   |  3 +--
 drivers/mmc/rockchip_dw_mmc.c |  3 +--
 drivers/mmc/socfpga_dw_mmc.c  |  3 +--
 include/dwmmc.h               |  8 +++-----
 5 files changed, 12 insertions(+), 18 deletions(-)

Comments

Simon Glass Sept. 27, 2016, 12:33 a.m. UTC | #1
On 23 September 2016 at 04:13, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> Some arguments don't need to pass to dwmci_setup_cfg.
> They are already included in dwmci_host structure.
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
>  drivers/mmc/dw_mmc.c          | 13 ++++++-------
>  drivers/mmc/exynos_dw_mmc.c   |  3 +--
>  drivers/mmc/rockchip_dw_mmc.c |  3 +--
>  drivers/mmc/socfpga_dw_mmc.c  |  3 +--
>  include/dwmmc.h               |  8 +++-----
>  5 files changed, 12 insertions(+), 18 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Jaehoon Chung Oct. 10, 2016, 6:34 a.m. UTC | #2
On 09/27/2016 09:33 AM, Simon Glass wrote:
> On 23 September 2016 at 04:13, Jaehoon Chung <jh80.chung@samsung.com> wrote:
>> Some arguments don't need to pass to dwmci_setup_cfg.
>> They are already included in dwmci_host structure.
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>> ---
>>  drivers/mmc/dw_mmc.c          | 13 ++++++-------
>>  drivers/mmc/exynos_dw_mmc.c   |  3 +--
>>  drivers/mmc/rockchip_dw_mmc.c |  3 +--
>>  drivers/mmc/socfpga_dw_mmc.c  |  3 +--
>>  include/dwmmc.h               |  8 +++-----
>>  5 files changed, 12 insertions(+), 18 deletions(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied on u-boot-mmc.

Best Regards,
Jaehoon Chung

> 
> 
>
diff mbox

Patch

diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index afc674d..e2028c2 100644
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -487,10 +487,10 @@  static const struct mmc_ops dwmci_ops = {
 };
 #endif
 
-void dwmci_setup_cfg(struct mmc_config *cfg, const char *name, int buswidth,
-		     uint caps, u32 max_clk, u32 min_clk)
+void dwmci_setup_cfg(struct mmc_config *cfg, struct dwmci_host *host,
+		u32 max_clk, u32 min_clk)
 {
-	cfg->name = name;
+	cfg->name = host->name;
 #ifndef CONFIG_DM_MMC_OPS
 	cfg->ops = &dwmci_ops;
 #endif
@@ -499,9 +499,9 @@  void dwmci_setup_cfg(struct mmc_config *cfg, const char *name, int buswidth,
 
 	cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195;
 
-	cfg->host_caps = caps;
+	cfg->host_caps = host->caps;
 
-	if (buswidth == 8) {
+	if (host->buswidth == 8) {
 		cfg->host_caps |= MMC_MODE_8BIT;
 		cfg->host_caps &= ~MMC_MODE_4BIT;
 	} else {
@@ -521,8 +521,7 @@  int dwmci_bind(struct udevice *dev, struct mmc *mmc, struct mmc_config *cfg)
 #else
 int add_dwmci(struct dwmci_host *host, u32 max_clk, u32 min_clk)
 {
-	dwmci_setup_cfg(&host->cfg, host->name, host->buswidth, host->caps,
-			max_clk, min_clk);
+	dwmci_setup_cfg(&host->cfg, host, max_clk, min_clk);
 
 	host->mmc = mmc_create(&host->cfg, host);
 	if (host->mmc == NULL)
diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
index 57271f1..d85442a 100644
--- a/drivers/mmc/exynos_dw_mmc.c
+++ b/drivers/mmc/exynos_dw_mmc.c
@@ -271,8 +271,7 @@  static int exynos_dwmmc_probe(struct udevice *dev)
 	if (err)
 		return err;
 
-	dwmci_setup_cfg(&plat->cfg, host->name, host->buswidth, host->caps,
-			DWMMC_MAX_FREQ, DWMMC_MIN_FREQ);
+	dwmci_setup_cfg(&plat->cfg, host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ);
 	host->mmc = &plat->mmc;
 	host->mmc->priv = &priv->host;
 	host->priv = dev;
diff --git a/drivers/mmc/rockchip_dw_mmc.c b/drivers/mmc/rockchip_dw_mmc.c
index 020a59b..5fdf2eb 100644
--- a/drivers/mmc/rockchip_dw_mmc.c
+++ b/drivers/mmc/rockchip_dw_mmc.c
@@ -129,8 +129,7 @@  static int rockchip_dwmmc_probe(struct udevice *dev)
 			return ret;
 	}
 #endif
-	dwmci_setup_cfg(&plat->cfg, dev->name, host->buswidth, host->caps,
-			priv->minmax[1], priv->minmax[0]);
+	dwmci_setup_cfg(&plat->cfg, host, priv->minmax[1], priv->minmax[0]);
 	host->mmc = &plat->mmc;
 	host->mmc->priv = &priv->host;
 	host->mmc->dev = dev;
diff --git a/drivers/mmc/socfpga_dw_mmc.c b/drivers/mmc/socfpga_dw_mmc.c
index 8a96302..5a3a4ff 100644
--- a/drivers/mmc/socfpga_dw_mmc.c
+++ b/drivers/mmc/socfpga_dw_mmc.c
@@ -111,8 +111,7 @@  static int socfpga_dwmmc_probe(struct udevice *dev)
 	struct dwmci_host *host = &priv->host;
 
 #ifdef CONFIG_BLK
-	dwmci_setup_cfg(&plat->cfg, dev->name, host->buswidth, host->caps,
-			host->bus_hz, 400000);
+	dwmci_setup_cfg(&plat->cfg, host, host->bus_hz, 400000);
 	host->mmc = &plat->mmc;
 #else
 	int ret;
diff --git a/include/dwmmc.h b/include/dwmmc.h
index 5b9602c..4dda009 100644
--- a/include/dwmmc.h
+++ b/include/dwmmc.h
@@ -253,14 +253,12 @@  static inline u8 dwmci_readb(struct dwmci_host *host, int reg)
  * See rockchip_dw_mmc.c for an example.
  *
  * @cfg:	Configuration structure to fill in (generally &plat->mmc)
- * @name:	Device name (normally dev->name)
- * @buswidth:	Bus width (in bits, such as 4 or 8)
- * @caps:	Host capabilities (MMC_MODE_...)
+ * @host:	DWMMC host
  * @max_clk:	Maximum supported clock speed in HZ (e.g. 150000000)
  * @min_clk:	Minimum supported clock speed in HZ (e.g. 400000)
  */
-void dwmci_setup_cfg(struct mmc_config *cfg, const char *name, int buswidth,
-		     uint caps, u32 max_clk, u32 min_clk);
+void dwmci_setup_cfg(struct mmc_config *cfg, struct dwmci_host *host,
+		u32 max_clk, u32 min_clk);
 
 /**
  * dwmci_bind() - Set up a new MMC block device