static int
ar8229_hw_init(struct ar8xxx_priv *priv)
{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
+ phy_interface_t phy_if_mode;
+#else
int phy_if_mode;
+#endif
if (priv->initialized)
return 0;
ar8xxx_write(priv, AR8216_REG_CTRL, AR8216_CTRL_RESET);
ar8xxx_reg_wait(priv, AR8216_REG_CTRL, AR8216_CTRL_RESET, 0, 1000);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
+ of_get_phy_mode(priv->pdev->of_node, &phy_if_mode);
+#else
phy_if_mode = of_get_phy_mode(priv->pdev->of_node);
+#endif
if (phy_if_mode == PHY_INTERFACE_MODE_GMII) {
ar8xxx_write(priv, AR8229_REG_OPER_MODE0,