diff mbox series

[U-Boot] arm: ls102xa: Fix RGMII phy-connection-type FDT fixup

Message ID 1531772904-1180-1-git-send-email-brendan.shanks@teradek.com
State Accepted
Commit e784cf1bf2a1fca2667198eea0d8031ae0ceeaf3
Delegated to: York Sun
Headers show
Series [U-Boot] arm: ls102xa: Fix RGMII phy-connection-type FDT fixup | expand

Commit Message

Brendan Shanks July 16, 2018, 8:28 p.m. UTC
In ft_fixup_enet_phy_connect_type(), use strlen() instead of sizeof() on
the pointer result of phy_string_for_interface().
sizeof() was returning the size of the pointer (4 bytes), resulting in
the phy-connection-type being set to "rgmi" rather than "rgmii-id".

Signed-off-by: Brendan Shanks <brendan.shanks@teradek.com>
Cc: York Sun <york.sun@nxp.com>
---
 arch/arm/cpu/armv7/ls102xa/fdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

York Sun Aug. 13, 2018, 4:21 p.m. UTC | #1
On 07/16/2018 01:28 PM, Brendan Shanks wrote:
> In ft_fixup_enet_phy_connect_type(), use strlen() instead of sizeof() on
> the pointer result of phy_string_for_interface().
> sizeof() was returning the size of the pointer (4 bytes), resulting in
> the phy-connection-type being set to "rgmi" rather than "rgmii-id".
> 
> Signed-off-by: Brendan Shanks <brendan.shanks@teradek.com>
> Cc: York Sun <york.sun@nxp.com>
> ---

Applied to fsl-qoriq master, awaiting upstream.
Thanks.

York
diff mbox series

Patch

diff --git a/arch/arm/cpu/armv7/ls102xa/fdt.c b/arch/arm/cpu/armv7/ls102xa/fdt.c
index 6c3caf8..8bf9c42 100644
--- a/arch/arm/cpu/armv7/ls102xa/fdt.c
+++ b/arch/arm/cpu/armv7/ls102xa/fdt.c
@@ -64,8 +64,8 @@  void ft_fixup_enet_phy_connect_type(void *fdt)
 		do_fixup_by_path(fdt, enet_path, "phy-connection-type",
 				 phy_string_for_interface(
 				 PHY_INTERFACE_MODE_RGMII_ID),
-				 sizeof(phy_string_for_interface(
-				 PHY_INTERFACE_MODE_RGMII_ID)),
+				 strlen(phy_string_for_interface(
+				 PHY_INTERFACE_MODE_RGMII_ID)) + 1,
 				 1);
 	}
 }