lkml.org 
[lkml]   [2018]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next v2 2/6] net: phy: mscc: add ethtool statistics counters
On Thu, Oct 04, 2018 at 02:47:24PM +0200, Quentin Schulz wrote:

Hi Quentin

> +static u64 vsc85xx_get_stat(struct phy_device *phydev, int i)
> +{
> + struct vsc8531_private *priv = phydev->priv;
> + int val, oldpage;
> + u64 ret;
> +
> + oldpage = phy_select_page(phydev, priv->hw_stats[i].page);
> +
> + val = __phy_read(phydev, priv->hw_stats[i].reg);
> + if (val < 0) {
> + ret = U64_MAX;
> + goto out;
> + }

phy_read_paged() should work here as well.

> +
> + val = val & priv->hw_stats[i].mask;
> + priv->stats[i] += val;
> + ret = priv->stats[i];

Otherwise this looks good.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Andrew

\
 
 \ /
  Last update: 2018-10-04 17:23    [W:0.624 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site