diff mbox

[11/18] mmc: meson-gx: remove unneeded variable in meson_mmc_clk_init

Message ID d08aa734-0258-3d53-9726-f7d9f47b51eb@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Heiner Kallweit Feb. 14, 2017, 8:06 p.m. UTC
Variable mux_parent_count can be replaced with constant
MUX_CLK_NUM_PARENTS, so remove it.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/mmc/host/meson-gx-mmc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Kevin Hilman Feb. 15, 2017, 7:24 p.m. UTC | #1
Heiner Kallweit <hkallweit1@gmail.com> writes:

> Variable mux_parent_count can be replaced with constant
> MUX_CLK_NUM_PARENTS, so remove it.

Before the above sentence, add "Because the DT requires a fixed number
of mux parent clocks, ..."

> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

With that,

Acked-by: Kevin Hilman <khilman@baylibre.com>

> ---
>  drivers/mmc/host/meson-gx-mmc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
> index 159ee7b4..d05ffe8a 100644
> --- a/drivers/mmc/host/meson-gx-mmc.c
> +++ b/drivers/mmc/host/meson-gx-mmc.c
> @@ -237,7 +237,6 @@ static int meson_mmc_clk_init(struct meson_host *host)
>  	char clk_name[32];
>  	int i, ret = 0;
>  	const char *mux_parent_names[MUX_CLK_NUM_PARENTS];
> -	unsigned int mux_parent_count = 0;
>  	const char *clk_div_parents[1];
>  	u32 clk_reg, cfg;
>  
> @@ -256,7 +255,6 @@ static int meson_mmc_clk_init(struct meson_host *host)
>  		}
>  
>  		mux_parent_names[i] = __clk_get_name(host->mux_parent[i]);
> -		mux_parent_count++;
>  	}
>  
>  	/* create the mux */
> @@ -265,7 +263,7 @@ static int meson_mmc_clk_init(struct meson_host *host)
>  	init.ops = &clk_mux_ops;
>  	init.flags = 0;
>  	init.parent_names = mux_parent_names;
> -	init.num_parents = mux_parent_count;
> +	init.num_parents = MUX_CLK_NUM_PARENTS;
>  
>  	host->mux.reg = host->regs + SD_EMMC_CLOCK;
>  	host->mux.shift = CLK_SRC_SHIFT;
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index 159ee7b4..d05ffe8a 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -237,7 +237,6 @@  static int meson_mmc_clk_init(struct meson_host *host)
 	char clk_name[32];
 	int i, ret = 0;
 	const char *mux_parent_names[MUX_CLK_NUM_PARENTS];
-	unsigned int mux_parent_count = 0;
 	const char *clk_div_parents[1];
 	u32 clk_reg, cfg;
 
@@ -256,7 +255,6 @@  static int meson_mmc_clk_init(struct meson_host *host)
 		}
 
 		mux_parent_names[i] = __clk_get_name(host->mux_parent[i]);
-		mux_parent_count++;
 	}
 
 	/* create the mux */
@@ -265,7 +263,7 @@  static int meson_mmc_clk_init(struct meson_host *host)
 	init.ops = &clk_mux_ops;
 	init.flags = 0;
 	init.parent_names = mux_parent_names;
-	init.num_parents = mux_parent_count;
+	init.num_parents = MUX_CLK_NUM_PARENTS;
 
 	host->mux.reg = host->regs + SD_EMMC_CLOCK;
 	host->mux.shift = CLK_SRC_SHIFT;