tcpm/anx74xx: initialize reg variable before use

When disabling auto_good_crc, the reg variable was being used
without initialization.  Mirror the code for enabling auto_good_crc
to set the variable.

TEST=Booted reef with updated code.
BUG=None
BRANCH=None

Change-Id: Ie552f2ff74df05750bd65b6344d8a80cc285f8b0
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/368221
Reviewed-by: David Hendricks <dhendrix@chromium.org>
This commit is contained in:
Martin Roth
2016-08-11 11:56:38 -06:00
committed by chrome-bot
parent de4d25964d
commit 7832ba6c4f

View File

@@ -44,6 +44,8 @@ static void anx74xx_tcpm_set_auto_good_crc(int port, int enable)
tcpc_read(port, ANX74XX_REG_TX_AUTO_GOODCRC_1, &reg);
reg |= ANX74XX_REG_AUTO_GOODCRC_EN;
} else {
/* Clear bit-0 for disable */
tcpc_read(port, ANX74XX_REG_TX_AUTO_GOODCRC_1, &reg);
reg &= ~ANX74XX_REG_AUTO_GOODCRC_EN;
tcpc_write(port, ANX74XX_REG_TX_AUTO_GOODCRC_2, 0);
}