Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a863a15b authored by Zhao, Gang's avatar Zhao, Gang Committed by Greg Kroah-Hartman
Browse files

staging: et131x: stop read when hit max delay in et131x_phy_mii_read



stop read and return error when hit max delay time.

Signed-off-by: default avatarZhao, Gang <gamerh2o@gmail.com>
Acked-by: default avatarMark Einon <mark.einon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ba92b225
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -1388,6 +1388,7 @@ static int et131x_phy_mii_read(struct et131x_adapter *adapter, u8 addr,
			    mii_indicator);
			    mii_indicator);


		status = -EIO;
		status = -EIO;
		goto out;
	}
	}


	/* If we hit here we were able to read the register and we need to
	/* If we hit here we were able to read the register and we need to
@@ -1395,6 +1396,7 @@ static int et131x_phy_mii_read(struct et131x_adapter *adapter, u8 addr,
	 */
	 */
	*value = readl(&mac->mii_mgmt_stat) & ET_MAC_MIIMGMT_STAT_PHYCRTL_MASK;
	*value = readl(&mac->mii_mgmt_stat) & ET_MAC_MIIMGMT_STAT_PHYCRTL_MASK;


out:
	/* Stop the read operation */
	/* Stop the read operation */
	writel(0, &mac->mii_mgmt_cmd);
	writel(0, &mac->mii_mgmt_cmd);