diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-05-03 20:10:53 +0300 |
---|---|---|
committer | Kishon Vijay Abraham I <kishon@ti.com> | 2018-05-20 21:51:22 +0530 |
commit | f9e8d0f7d0a3de468e2d28eefd13099b6319e953 (patch) | |
tree | ba5e333a03ed5cc343e6ac6e5eb391a9131b27bf /drivers/phy/tegra | |
parent | cd3bf368aa7a352a577be7b9540c6b5b2681bf17 (diff) | |
download | linux-f9e8d0f7d0a3de468e2d28eefd13099b6319e953.tar.bz2 |
phy: tegra: Convert to use match_string() helper
The new helper returns index of the matching string in an array.
We are going to use it here.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/phy/tegra')
-rw-r--r-- | drivers/phy/tegra/xusb.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c index 11aa5902a9ac..de1b4ebe4de2 100644 --- a/drivers/phy/tegra/xusb.c +++ b/drivers/phy/tegra/xusb.c @@ -102,19 +102,6 @@ tegra_xusb_pad_find_phy_node(struct tegra_xusb_pad *pad, unsigned int index) return np; } -static int -tegra_xusb_lane_lookup_function(struct tegra_xusb_lane *lane, - const char *function) -{ - unsigned int i; - - for (i = 0; i < lane->soc->num_funcs; i++) - if (strcmp(function, lane->soc->funcs[i]) == 0) - return i; - - return -EINVAL; -} - int tegra_xusb_lane_parse_dt(struct tegra_xusb_lane *lane, struct device_node *np) { @@ -126,7 +113,7 @@ int tegra_xusb_lane_parse_dt(struct tegra_xusb_lane *lane, if (err < 0) return err; - err = tegra_xusb_lane_lookup_function(lane, function); + err = match_string(lane->soc->funcs, lane->soc->num_funcs, function); if (err < 0) { dev_err(dev, "invalid function \"%s\" for lane \"%s\"\n", function, np->name); |