mmc: meson-gx: Convert to pinctrl_select_default_state()
authorUlf Hansson <ulf.hansson@linaro.org>
Fri, 6 Dec 2019 17:08:14 +0000 (18:08 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 16 Dec 2019 12:00:41 +0000 (13:00 +0100)
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>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20191206170821.29711-3-ulf.hansson@linaro.org
drivers/mmc/host/meson-gx-mmc.c

index e712315..35400cf 100644 (file)
@@ -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)) {