mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Cc: Hu Ziji <[email protected]> Cc: Ulf Hansson <[email protected]> Cc: [email protected] Signed-off-by: Yisheng Xie <[email protected]> Acked-by: Adrian Hunter <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
This commit is contained in:
parent
8603f1e838
commit
e1cb88ad46
1 changed files with 3 additions and 8 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue