From: Pawel Dembicki Date: Thu, 19 Oct 2023 10:07:03 +0000 (+0200) Subject: layerscape: port "-Werror" fix from NXP tree X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f54b752764ee92062afc39def1f0138a68ba3872;p=openwrt%2Fstaging%2Fthess.git layerscape: port "-Werror" fix from NXP tree At this moment, 702-phy-Add-2.5G-SGMII-interface-mode.patch cause error durring kernel compilation: CC drivers/net/phy/phylink.o drivers/net/phy/phylink.c: In function 'phylink_get_capabilities': drivers/net/phy/phylink.c:443:9: error: enumeration value 'PHY_INTERFACE_MODE_2500SGMII' not handled in switch [-Werror=switch] 443 | switch (interface) { | ^~~~~~ cc1: all warnings being treated as errors NXP take care of it. Let's port their patch. Signed-off-by: Pawel Dembicki --- diff --git a/target/linux/layerscape/patches-6.1/704-net-phylink-treat-PHY_INTERFACE_MODE_2500SGMII-in-ph.patch b/target/linux/layerscape/patches-6.1/704-net-phylink-treat-PHY_INTERFACE_MODE_2500SGMII-in-ph.patch new file mode 100644 index 0000000000..79586b742e --- /dev/null +++ b/target/linux/layerscape/patches-6.1/704-net-phylink-treat-PHY_INTERFACE_MODE_2500SGMII-in-ph.patch @@ -0,0 +1,47 @@ +From eb57941154e2ad142c07d47e874a221328467349 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Thu, 2 Jun 2022 12:11:11 +0300 +Subject: [PATCH] net: phylink: treat PHY_INTERFACE_MODE_2500SGMII in + phylink_get_linkmodes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +There is a downstream patch which adds a new interface type - +PHY_INTERFACE_MODE_2500SGMII (which is really the same one as +PHY_INTERFACE_MODE_2500BASEX). + +We backported from upstream the following phylink patch which, of +course, does not treat the PHY_INTERFACE_MODE_2500SGMII interface mode +in a switch case statement. + 34ae2c09d46a ("net: phylink: add generic validate implementation") + +Because of this, we get the following build warning. + +drivers/net/phy/phylink.c: In function ‘phylink_get_linkmodes’: +drivers/net/phy/phylink.c:322:2: warning: enumeration value ‘PHY_INTERFACE_MODE_2500SGMII’ not handled in switch [-Wswitch] + 322 | switch (interface) { + | ^~~~~~ + +Fix it by treating the new interface mode in the switch-case statement. + +Signed-off-by: Ioana Ciornei +--- + drivers/net/phy/phylink.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c +index 2805b04d6402..a1e34b127401 100644 +--- a/drivers/net/phy/phylink.c ++++ b/drivers/net/phy/phylink.c +@@ -479,6 +479,7 @@ unsigned long phylink_get_capabilities(phy_interface_t interface, + break; + + case PHY_INTERFACE_MODE_2500BASEX: ++ case PHY_INTERFACE_MODE_2500SGMII: + caps |= MAC_2500FD; + break; + +-- +2.25.1 +