Skip to content

Commit

Permalink
staging: et131x: stop read when hit max delay in et131x_phy_mii_read
Browse files Browse the repository at this point in the history
stop read and return error when hit max delay time.

Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>
Acked-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
zhao-gang authored and gregkh committed Feb 7, 2014
1 parent ba92b22 commit a863a15
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/et131x/et131x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1388,13 +1388,15 @@ static int et131x_phy_mii_read(struct et131x_adapter *adapter, u8 addr,
mii_indicator);

status = -EIO;
goto out;
}

/* If we hit here we were able to read the register and we need to
* return the value to the caller
*/
*value = readl(&mac->mii_mgmt_stat) & ET_MAC_MIIMGMT_STAT_PHYCRTL_MASK;

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

Expand Down

0 comments on commit a863a15

Please sign in to comment.