summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@gmail.com>2018-08-07 12:24:35 +0200
committerMarek Vasut <marex@denx.de>2018-08-14 11:31:19 +0200
commit5e50adf6679831bc34a567a1bf20ff1642c418dd (patch)
tree1a4774863909adf711668c9ca000c2329ee69eca
parenta032e0a6aed208977f48e78d2cc497b91543beaf (diff)
phy: Fix off-by-one error when parsing DT PHY bindings
The code fails to copy the last PHY phandle argument, so it is missing from the adjusted phandle args and the consumer cannot use it to determine what the PHY should do. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Patrice Chotard <patrice.chotard@st.com>
-rw-r--r--drivers/phy/phy-uclass.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/phy/phy-uclass.c b/drivers/phy/phy-uclass.c
index 6162395e75..a0ac30aa71 100644
--- a/drivers/phy/phy-uclass.c
+++ b/drivers/phy/phy-uclass.c
@@ -64,7 +64,7 @@ int generic_phy_get_by_index(struct udevice *dev, int index,
return ret;
/* insert phy idx at first position into args array */
- for (i = args.args_count; i > 1 ; i--)
+ for (i = args.args_count; i >= 1 ; i--)
args.args[i] = args.args[i - 1];
args.args_count++;