/* Initialize a list of TCM825X registers. The list of registers is terminated by the pair of values { TCM825X_REG_TERM, TCM825X_VAL_TERM }. Returns zero if successful, or non-zero otherwise.  */
static int tcm825x_write_default_regs(struct i2c_client *client, const struct tcm825x_reg *reglist)
/* Initialize a list of TCM825X registers. The list of registers is terminated by the pair of values { TCM825X_REG_TERM, TCM825X_VAL_TERM }. Returns zero if successful, or non-zero otherwise.  */
static int tcm825x_write_default_regs(struct i2c_client *client, const struct tcm825x_reg *reglist)
{
	int err;
	const struct tcm825x_reg *next = reglist;
	while (!((next->reg == TCM825X_REG_TERM)
		 && (next->val == TCM825X_VAL_TERM))) {
		err = tcm825x_write_reg(client, next->reg, next->val);
		if (err) {
			dev_err(&client->dev, "register writing failed\n");
			return err;
		}
		next++;
	}
	return 0;
}