Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9e8d0f7 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Kishon Vijay Abraham I
Browse files

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parent cd3bf368
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -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);