diff mbox

[12/18] mmc: meson-gx: remove member parent_mux from struct meson_host

Message ID ef34f765-cb48-9381-4a0c-e6f540612ea6@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Heiner Kallweit Feb. 14, 2017, 8:06 p.m. UTC
Member mux_parent isn't used outside meson_mmc_clk_init. So remove it
and replace it with a local variable in meson_mmc_clk_init.

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

Comments

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

> Member mux_parent isn't used outside meson_mmc_clk_init. So remove it
> and replace it with a local variable in meson_mmc_clk_init.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

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

> ---
>  drivers/mmc/host/meson-gx-mmc.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
> index d05ffe8a..74ceda75 100644
> --- a/drivers/mmc/host/meson-gx-mmc.c
> +++ b/drivers/mmc/host/meson-gx-mmc.c
> @@ -131,7 +131,6 @@ struct meson_host {
>  	struct clk *core_clk;
>  	struct clk_mux mux;
>  	struct clk *mux_clk;
> -	struct clk *mux_parent[MUX_CLK_NUM_PARENTS];
>  	unsigned long current_clock;
>  
>  	struct clk_divider cfg_div;
> @@ -242,19 +241,18 @@ static int meson_mmc_clk_init(struct meson_host *host)
>  
>  	/* get the mux parents */
>  	for (i = 0; i < MUX_CLK_NUM_PARENTS; i++) {
> +		struct clk *clk;
>  		char name[16];
>  
>  		snprintf(name, sizeof(name), "clkin%d", i);
> -		host->mux_parent[i] = devm_clk_get(host->dev, name);
> -		if (IS_ERR(host->mux_parent[i])) {
> -			ret = PTR_ERR(host->mux_parent[i]);
> -			if (PTR_ERR(host->mux_parent[i]) != -EPROBE_DEFER)
> +		clk = devm_clk_get(host->dev, name);
> +		if (IS_ERR(clk)) {
> +			if (clk != ERR_PTR(-EPROBE_DEFER))
>  				dev_err(host->dev, "Missing clock %s\n", name);
> -			host->mux_parent[i] = NULL;
> -			return ret;
> +			return PTR_ERR(clk);
>  		}
>  
> -		mux_parent_names[i] = __clk_get_name(host->mux_parent[i]);
> +		mux_parent_names[i] = __clk_get_name(clk);
>  	}
>  
>  	/* create the mux */
--
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 d05ffe8a..74ceda75 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -131,7 +131,6 @@  struct meson_host {
 	struct clk *core_clk;
 	struct clk_mux mux;
 	struct clk *mux_clk;
-	struct clk *mux_parent[MUX_CLK_NUM_PARENTS];
 	unsigned long current_clock;
 
 	struct clk_divider cfg_div;
@@ -242,19 +241,18 @@  static int meson_mmc_clk_init(struct meson_host *host)
 
 	/* get the mux parents */
 	for (i = 0; i < MUX_CLK_NUM_PARENTS; i++) {
+		struct clk *clk;
 		char name[16];
 
 		snprintf(name, sizeof(name), "clkin%d", i);
-		host->mux_parent[i] = devm_clk_get(host->dev, name);
-		if (IS_ERR(host->mux_parent[i])) {
-			ret = PTR_ERR(host->mux_parent[i]);
-			if (PTR_ERR(host->mux_parent[i]) != -EPROBE_DEFER)
+		clk = devm_clk_get(host->dev, name);
+		if (IS_ERR(clk)) {
+			if (clk != ERR_PTR(-EPROBE_DEFER))
 				dev_err(host->dev, "Missing clock %s\n", name);
-			host->mux_parent[i] = NULL;
-			return ret;
+			return PTR_ERR(clk);
 		}
 
-		mux_parent_names[i] = __clk_get_name(host->mux_parent[i]);
+		mux_parent_names[i] = __clk_get_name(clk);
 	}
 
 	/* create the mux */