mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-23 09:42:19 +03:00
nvethernet: check return code for set_speed
osi_set_speed will return error if there is no set_speed callback defined or if something error happened while setting speed. Bug 200565886 Change-Id: I9c74364d1a2e951059c3718c719314424b13c729 Signed-off-by: Bhadram Varka <vbhadram@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2314494 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Revanth Kumar Uppala
parent
35f2dceb54
commit
69cf090fde
@@ -271,10 +271,12 @@ static void ether_adjust_link(struct net_device *dev)
|
|||||||
int new_state = 0, speed_changed = 0;
|
int new_state = 0, speed_changed = 0;
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
unsigned int eee_enable = OSI_DISABLE;
|
unsigned int eee_enable = OSI_DISABLE;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
if (phydev == NULL) {
|
if (phydev == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phydev->link) {
|
if (phydev->link) {
|
||||||
if ((pdata->osi_core->pause_frames == OSI_PAUSE_FRAMES_ENABLE)
|
if ((pdata->osi_core->pause_frames == OSI_PAUSE_FRAMES_ENABLE)
|
||||||
&& (phydev->pause || phydev->asym_pause)) {
|
&& (phydev->pause || phydev->asym_pause)) {
|
||||||
@@ -291,7 +293,12 @@ static void ether_adjust_link(struct net_device *dev)
|
|||||||
if (phydev->speed != pdata->speed) {
|
if (phydev->speed != pdata->speed) {
|
||||||
new_state = 1;
|
new_state = 1;
|
||||||
speed_changed = 1;
|
speed_changed = 1;
|
||||||
osi_set_speed(pdata->osi_core, phydev->speed);
|
ret = osi_set_speed(pdata->osi_core, phydev->speed);
|
||||||
|
if (ret < 0) {
|
||||||
|
netdev_err(dev, "Failed to set speed\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
pdata->speed = phydev->speed;
|
pdata->speed = phydev->speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user