phy: Fix off-by-one error when parsing DT PHY bindings
PATCH 1/1 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.
--- drivers/phy/phy-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/phy-uclass.c +1 -1
@@ -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++;
Signature · 1 line
2.16.2
PATCH 1/1 phy: Fix off-by-one error when parsing DT PHY bindings
Hi Marek
Quoted 16 lines · Marek Vasut
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 <[email protected]>Cc Patrice Chotard <[email protected]>--- drivers/phy/phy-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/phy/phy-uclass.c +0
-0
drivers/phy/phy-uclass.c int generic_phy_get_by_index(struct udevice *dev, int index, · line 70
Quoted 8 lines
drivers/phy/phy-uclass.c +1
-1@@ -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++;
Thanks
PATCH 1/1 phy: Fix off-by-one error when parsing DT PHY bindings
Quoted 25 lines · Patrice CHOTARD
Hi Marek
Quoted 22 lines · Marek Vasut
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 <[email protected]>Cc Patrice Chotard <[email protected]>--- drivers/phy/phy-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/phy/phy-uclass.c +1
-1@@ -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 ];
Quoted 4 lines
drivers/phy/phy-uclass.c int generic_phy_get_by_index(struct udevice *dev, int index, · line 70
Quoted 2 lines
drivers/phy/phy-uclass.c +0
-0args.args_count++;Reviewed-by Patrice Chotard <[email protected]>
Who's picking this up ?
Signature · 2 lines
Best regards, Marek Vasut