diff mbox series

[2/9] mmc: meson-gx: Convert to pinctrl_select_default_state()

Message ID 20191206170821.29711-3-ulf.hansson@linaro.org
State Accepted
Commit f9be7f9c358d9e7c94cda994eedadbd3571e787a
Headers show
Series pinctrl: Consolidate some pinctrl code for mmc | expand

Commit Message

Ulf Hansson Dec. 6, 2019, 5:08 p.m. UTC
Let's drop the boilerplate code for managing the default pinctrl state and
convert into using the new pinctrl_select_default_state().

Cc: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

---
 drivers/mmc/host/meson-gx-mmc.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

-- 
2.17.1

Comments

Jerome Brunet Dec. 10, 2019, 10:06 a.m. UTC | #1
On Fri 06 Dec 2019 at 18:08, Ulf Hansson <ulf.hansson@linaro.org> wrote:

> Let's drop the boilerplate code for managing the default pinctrl state and

> convert into using the new pinctrl_select_default_state().

>


Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>


> Cc: Kevin Hilman <khilman@baylibre.com>

> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

> ---

>  drivers/mmc/host/meson-gx-mmc.c | 10 +---------

>  1 file changed, 1 insertion(+), 9 deletions(-)

>

> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c

> index e712315c7e8d..35400cf2a2e4 100644

> --- a/drivers/mmc/host/meson-gx-mmc.c

> +++ b/drivers/mmc/host/meson-gx-mmc.c

> @@ -161,7 +161,6 @@ struct meson_host {

>  	bool dram_access_quirk;

>  

>  	struct pinctrl *pinctrl;

> -	struct pinctrl_state *pins_default;

>  	struct pinctrl_state *pins_clk_gate;

>  

>  	unsigned int bounce_buf_size;

> @@ -327,7 +326,7 @@ static void meson_mmc_clk_ungate(struct meson_host *host)

>  	u32 cfg;

>  

>  	if (host->pins_clk_gate)

> -		pinctrl_select_state(host->pinctrl, host->pins_default);

> +		pinctrl_select_default_state(host->dev);

>  

>  	/* Make sure the clock is not stopped in the controller */

>  	cfg = readl(host->regs + SD_EMMC_CFG);

> @@ -1101,13 +1100,6 @@ static int meson_mmc_probe(struct platform_device *pdev)

>  		goto free_host;

>  	}

>  

> -	host->pins_default = pinctrl_lookup_state(host->pinctrl,

> -						  PINCTRL_STATE_DEFAULT);

> -	if (IS_ERR(host->pins_default)) {

> -		ret = PTR_ERR(host->pins_default);

> -		goto free_host;

> -	}

> -

>  	host->pins_clk_gate = pinctrl_lookup_state(host->pinctrl,

>  						   "clk-gate");

>  	if (IS_ERR(host->pins_clk_gate)) {
diff mbox series

Patch

diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index e712315c7e8d..35400cf2a2e4 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -161,7 +161,6 @@  struct meson_host {
 	bool dram_access_quirk;
 
 	struct pinctrl *pinctrl;
-	struct pinctrl_state *pins_default;
 	struct pinctrl_state *pins_clk_gate;
 
 	unsigned int bounce_buf_size;
@@ -327,7 +326,7 @@  static void meson_mmc_clk_ungate(struct meson_host *host)
 	u32 cfg;
 
 	if (host->pins_clk_gate)
-		pinctrl_select_state(host->pinctrl, host->pins_default);
+		pinctrl_select_default_state(host->dev);
 
 	/* Make sure the clock is not stopped in the controller */
 	cfg = readl(host->regs + SD_EMMC_CFG);
@@ -1101,13 +1100,6 @@  static int meson_mmc_probe(struct platform_device *pdev)
 		goto free_host;
 	}
 
-	host->pins_default = pinctrl_lookup_state(host->pinctrl,
-						  PINCTRL_STATE_DEFAULT);
-	if (IS_ERR(host->pins_default)) {
-		ret = PTR_ERR(host->pins_default);
-		goto free_host;
-	}
-
 	host->pins_clk_gate = pinctrl_lookup_state(host->pinctrl,
 						   "clk-gate");
 	if (IS_ERR(host->pins_clk_gate)) {