/* Write a value to a register and check that the write completed. These writes normally complete in a cycle or two, so one read should suffice. The very first read exists to flush the posted write to the device.  */
static int wrreg_wait(struct adapter *adapter, unsigned int addr, u32 val)
/* Write a value to a register and check that the write completed. These writes normally complete in a cycle or two, so one read should suffice. The very first read exists to flush the posted write to the device.  */
static int wrreg_wait(struct adapter *adapter, unsigned int addr, u32 val)
{
	t3_write_reg(adapter, addr, val);
	t3_read_reg(adapter, addr);
	if (!(t3_read_reg(adapter, addr) & F_BUSY))
		return 0;
	CH_ERR(adapter, "write to MC7 register 0x%x timed out\n", addr);
	return -EIO;
}