diff options
author | Xie Yisheng <xieyisheng1@huawei.com> | 2018-05-21 19:57:53 +0800 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2018-05-28 12:45:28 +0200 |
commit | e1cb88ad4655dd7484e56c01a05a2986496f56a8 (patch) | |
tree | 8fdfa1743342567352ae1be4ced629cb261e34b7 /drivers | |
parent | 8603f1e83897d3e4ed28c2c51ed6e8ef675908d9 (diff) | |
download | linux-stable-e1cb88ad4655dd7484e56c01a05a2986496f56a8.tar.gz linux-stable-e1cb88ad4655dd7484e56c01a05a2986496f56a8.tar.bz2 linux-stable-e1cb88ad4655dd7484e56c01a05a2986496f56a8.zip |
mmc: sdhci-xenon: use match_string() helper
match_string() returns the index of an array for a matching string,
which can be used intead of open coded variant.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Hu Ziji <huziji@marvell.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/host/sdhci-xenon-phy.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/mmc/host/sdhci-xenon-phy.c b/drivers/mmc/host/sdhci-xenon-phy.c index ec8794335241..a35804b203a7 100644 --- a/drivers/mmc/host/sdhci-xenon-phy.c +++ b/drivers/mmc/host/sdhci-xenon-phy.c @@ -814,15 +814,10 @@ static int xenon_add_phy(struct device_node *np, struct sdhci_host *host, { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct xenon_priv *priv = sdhci_pltfm_priv(pltfm_host); - int i, ret; + int ret; - for (i = 0; i < NR_PHY_TYPES; i++) { - if (!strcmp(phy_name, phy_types[i])) { - priv->phy_type = i; - break; - } - } - if (i == NR_PHY_TYPES) { + priv->phy_type = match_string(phy_types, NR_PHY_TYPES, phy_name); + if (priv->phy_type < 0) { dev_err(mmc_dev(host->mmc), "Unable to determine PHY name %s. Use default eMMC 5.1 PHY\n", phy_name); |