mmc: mmci: Convert to pinctrl_select_default_state()
authorUlf Hansson <ulf.hansson@linaro.org>
Fri, 6 Dec 2019 17:08:15 +0000 (18:08 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 16 Dec 2019 12:00:49 +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().

Additionally, move away from using pinctrl_pm_select_default_state() as
it's scheduled for removal and use pinctrl_select_default_state() instead.

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20191206170821.29711-4-ulf.hansson@linaro.org
drivers/mmc/host/mmci.c
drivers/mmc/host/mmci.h

index 40e72c3..caaa468 100644 (file)
@@ -1704,7 +1704,7 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
                if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN)
                        pinctrl_select_state(host->pinctrl, host->pins_opendrain);
                else
-                       pinctrl_select_state(host->pinctrl, host->pins_default);
+                       pinctrl_select_default_state(mmc_dev(mmc));
        }
 
        /*
@@ -1877,14 +1877,6 @@ static int mmci_probe(struct amba_device *dev,
                        goto host_free;
                }
 
-               host->pins_default = pinctrl_lookup_state(host->pinctrl,
-                                                         PINCTRL_STATE_DEFAULT);
-               if (IS_ERR(host->pins_default)) {
-                       dev_err(mmc_dev(mmc), "Can't select default pins\n");
-                       ret = PTR_ERR(host->pins_default);
-                       goto host_free;
-               }
-
                host->pins_opendrain = pinctrl_lookup_state(host->pinctrl,
                                                            MMCI_PINCTRL_STATE_OPENDRAIN);
                if (IS_ERR(host->pins_opendrain)) {
@@ -2203,7 +2195,7 @@ static int mmci_runtime_resume(struct device *dev)
                struct mmci_host *host = mmc_priv(mmc);
                clk_prepare_enable(host->clk);
                mmci_restore(host);
-               pinctrl_pm_select_default_state(dev);
+               pinctrl_select_default_state(dev);
        }
 
        return 0;
index 158e123..12d4ed8 100644 (file)
@@ -404,7 +404,6 @@ struct mmci_host {
        struct mmci_host_ops    *ops;
        struct variant_data     *variant;
        struct pinctrl          *pinctrl;
-       struct pinctrl_state    *pins_default;
        struct pinctrl_state    *pins_opendrain;
 
        u8                      hw_designer;