Re: [PATCH v2 net-next 4/9] net: dsa: microchip: add DSA support for microchip lan937x

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +static void lan937x_r_mib_cnt(struct ksz_device *dev, int port, u16 addr,
> +			      u64 *cnt)
> +{
> +	unsigned int val;
> +	u32 data;
> +	int ret;
> +
> +	/* Enable MIB Counter read*/
> +	data = MIB_COUNTER_READ;
> +	data |= (addr << MIB_COUNTER_INDEX_S);
> +	lan937x_pwrite32(dev, port, REG_PORT_MIB_CTRL_STAT__4, data);
> +
> +	ret = regmap_read_poll_timeout(dev->regmap[2],
> +				       PORT_CTRL_ADDR(port,
> +						      REG_PORT_MIB_CTRL_STAT__4),
> +					   val, !(val & MIB_COUNTER_READ), 10, 1000);
> +	/* failed to read MIB. get out of loop */

Another loop which is not a loop. Please review your comments and
check they make sense.

      Andrew



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux