ipq40xx: qca807x: adapt for 6.1
authorRobert Marko <robimarko@gmail.com>
Mon, 14 Aug 2023 16:42:18 +0000 (18:42 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Sun, 17 Sep 2023 19:00:23 +0000 (21:00 +0200)
Kernel 6.1 has changed format of sfp_parse_support(), so lets adapt to
those changes so it works on newer kernels as well.

Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/ipq40xx/files/drivers/net/phy/qca807x.c

index 23b0ca74f7142f47ff3c30c63fab62b7e8b7e350..abfc11e121c1bf7ac5099c1427f46d12f2b2ff8a 100644 (file)
@@ -644,8 +644,13 @@ static int qca807x_sfp_insert(void *upstream, const struct sfp_eeprom_id *id)
        __ETHTOOL_DECLARE_LINK_MODE_MASK(support) = { 0, };
        phy_interface_t iface;
        int ret;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
+       DECLARE_PHY_INTERFACE_MASK(interfaces);
 
+       sfp_parse_support(phydev->sfp_bus, id, support, interfaces);
+#else
        sfp_parse_support(phydev->sfp_bus, id, support);
+#endif
        iface = sfp_select_interface(phydev->sfp_bus, support);
 
        dev_info(&phydev->mdio.dev, "%s SFP module inserted\n", phy_modes(iface));