pi = np->vsi->port_info;
 
        if (!pi)
-               return -EOPNOTSUPP;
+               return -EIO;
 
        if (pi->phy.media_type != ICE_MEDIA_BASET &&
            pi->phy.media_type != ICE_MEDIA_FIBER &&
        status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_TOPO_CAP_MEDIA,
                                     phy_caps, NULL);
        if (status) {
-               err = -EAGAIN;
+               err = -EIO;
                goto done;
        }
 
                           __ETHTOOL_LINK_MODE_MASK_NBITS)) {
                if (!test_bit(ICE_FLAG_LINK_LENIENT_MODE_ENA, pf->flags))
                        netdev_info(netdev, "The selected speed is not supported by the current media. Please select a link speed that is supported by the current media.\n");
-               err = -EINVAL;
+               err = -EOPNOTSUPP;
                goto done;
        }
 
        pi->phy.get_link_info = true;
        status = ice_get_link_status(pi, &linkup);
        if (status) {
-               err = -EAGAIN;
+               err = -EIO;
                goto done;
        }
 
        /* check if there is a PHY type for the requested advertised speed */
        if (!(phy_type_low || phy_type_high)) {
                netdev_info(netdev, "The selected speed is not supported by the current media. Please select a link speed that is supported by the current media.\n");
-               err = -EAGAIN;
+               err = -EOPNOTSUPP;
                goto done;
        }
 
                                              pf->nvm_phy_type_lo;
                } else {
                        netdev_info(netdev, "The selected speed is not supported by the current media. Please select a link speed that is supported by the current media.\n");
-                       err = -EAGAIN;
+                       err = -EOPNOTSUPP;
                        goto done;
                }
        }
        status = ice_aq_set_phy_cfg(&pf->hw, pi, &config, NULL);
        if (status) {
                netdev_info(netdev, "Set phy config failed,\n");
-               err = -EAGAIN;
+               err = -EIO;
                goto done;
        }