diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2021-06-17 13:53:22 +0200 |
---|---|---|
committer | Corey Minyard <cminyard@mvista.com> | 2021-07-08 14:15:01 -0500 |
commit | e91113d0f9481c072f74e8390399e11b93856844 (patch) | |
tree | 7c9167b430c96397bd82273e8cf18b9c030799f4 /hw | |
parent | 426f53de9c2110b6c2a05fdc1a89f2e0c1a0b97e (diff) | |
download | qemu-e91113d0f9481c072f74e8390399e11b93856844.zip qemu-e91113d0f9481c072f74e8390399e11b93856844.tar.gz qemu-e91113d0f9481c072f74e8390399e11b93856844.tar.bz2 |
hw/display/sm501: Simplify sm501_i2c_write() logic
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/display/sm501.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 8789722..f276276 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -1036,8 +1036,9 @@ static void sm501_i2c_write(void *opaque, hwaddr addr, uint64_t value, int res = i2c_start_transfer(s->i2c_bus, s->i2c_addr >> 1, s->i2c_addr & 1); - s->i2c_status |= (res ? SM501_I2C_STATUS_ERROR : 0); - if (!res) { + if (res) { + s->i2c_status |= SM501_I2C_STATUS_ERROR; + } else { int i; for (i = 0; i <= s->i2c_byte_count; i++) { res = i2c_send_recv(s->i2c_bus, &s->i2c_data[i], |