]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: fix phy_string_for_interface
authorTim Harvey <tharvey@gateworks.com>
Tue, 10 May 2022 22:49:10 +0000 (15:49 -0700)
committerTom Rini <trini@konsulko.com>
Mon, 23 May 2022 17:52:02 +0000 (13:52 -0400)
commit ffb0f6f488b9 ("treewide: Rename PHY_INTERFACE_MODE_NONE to
PHY_INTERFACE_MODE_NA") broke the phy_string_for_interface function.
Fix it.

Fixes ffb0f6f488b9 ("treewide: Rename PHY_INTERFACE_MODE_NONE to PHY_INTERFACE_MODE_NA")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Cc: Marek BehĂșn <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Cc: Ramon Fried <rfried.dev@gmail.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Marek BehĂșn <marek.behun@nic.cz>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
include/phy_interface.h

index ce3b5004ec22923c3c89e21bef4575329e53da74..fed3357b9a26f55191efa5fd3a286135d72e8d63 100644 (file)
@@ -85,7 +85,7 @@ static const char * const backplane_mode_strings[] = {
 static inline const char *phy_string_for_interface(phy_interface_t i)
 {
        /* Default to unknown */
-       if (i > PHY_INTERFACE_MODE_NA)
+       if (i >= PHY_INTERFACE_MODE_MAX)
                i = PHY_INTERFACE_MODE_NA;
 
        return phy_interface_strings[i];