Skip to content

ethernet: dwc_xgmac: use phy api correctly #88716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions drivers/ethernet/dwc_xgmac/eth_dwc_xgmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,6 @@ static int eth_dwc_xgmac_set_config(const struct device *dev, enum ethernet_conf
const struct eth_dwc_xgmac_config *dev_conf = (struct eth_dwc_xgmac_config *)dev->config;
struct eth_dwc_xgmac_dev_data *dev_data = (struct eth_dwc_xgmac_dev_data *)dev->data;
const struct device *phy = dev_conf->phy_dev;
const struct ethphy_driver_api *phy_api = phy->api;
enum phy_link_speed adv_speeds;

int retval = 0;
Expand All @@ -1577,7 +1576,7 @@ static int eth_dwc_xgmac_set_config(const struct device *dev, enum ethernet_conf
adv_speeds =
get_phy_adv_speeds(dev_data->auto_neg, dev_data->enable_full_duplex,
dev_data->link_speed);
retval = phy_api->cfg_link(phy, adv_speeds);
retval = phy_configure_link(phy, adv_speeds);
} else {
retval = -EALREADY;
}
Expand All @@ -1599,7 +1598,7 @@ static int eth_dwc_xgmac_set_config(const struct device *dev, enum ethernet_conf
}
adv_speeds = get_phy_adv_speeds(dev_data->auto_neg, dev_data->enable_full_duplex,
dev_data->link_speed);
retval = phy_api->cfg_link(phy, adv_speeds);
retval = phy_configure_link(phy, adv_speeds);
break;
case ETHERNET_CONFIG_TYPE_DUPLEX:
if (config->full_duplex == dev_data->enable_full_duplex) {
Expand All @@ -1610,7 +1609,7 @@ static int eth_dwc_xgmac_set_config(const struct device *dev, enum ethernet_conf

adv_speeds = get_phy_adv_speeds(dev_data->auto_neg, dev_data->enable_full_duplex,
dev_data->link_speed);
retval = phy_api->cfg_link(phy, adv_speeds);
retval = phy_configure_link(phy, adv_speeds);
break;
case ETHERNET_CONFIG_TYPE_MAC_ADDRESS:
memcpy(dev_data->mac_addr, config->mac_address.addr, ETH_MAC_ADDRESS_SIZE);
Expand Down