arm: ls102xa: Fix RGMII phy-connection-type FDT fixup
authorBrendan Shanks <brendan.shanks@teradek.com>
Mon, 16 Jul 2018 20:28:24 +0000 (13:28 -0700)
committerYork Sun <york.sun@nxp.com>
Tue, 7 Aug 2018 21:42:15 +0000 (14:42 -0700)
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>
Reviewed-by: York Sun <york.sun@nxp.com>
arch/arm/cpu/armv7/ls102xa/fdt.c

index 6c3caf84b20fe9d3a12a24aa8608d783df9d13e6..8bf9c42b2260870e6cf0cc308e22f8dcbba3ab74 100644 (file)
@@ -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);
        }
 }