driver: i2c: npcx: don't print the err log when SMBST is zero

In the I2C ISR, it prints the error message when SMBST is set to an
unexpected value. However, we found a spurious interrupt which caused
the SoC to enter the ISR with SMBST=0. Because the spurious interrupt
will not break the I2C operation, this commit limits the error log to
print if SMBST is not equivalent to 0 to prevent a false alert.

Signed-off-by: Andrew McRae <amcrae@google.com>
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
This commit is contained in:
Jun Lin 2022-02-22 10:25:51 +08:00 committed by Marti Bolivar
commit 0bbf394ced

View file

@ -739,9 +739,11 @@ static void i2c_ctrl_isr(const struct device *dev)
}
/* Clear unexpected status bits */
if (status != 0) {
inst_fifo->SMBST = status;
LOG_ERR("Unexpected SMBST 0x%02x occurred on i2c port%02x!", status,
data->port);
LOG_ERR("Unexpected SMBST 0x%02x occurred on i2c port%02x!",
status, data->port);
}
}
/* NPCX specific I2C controller functions */