[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 02/12] i2c: have I2C receive operation return
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 02/12] i2c: have I2C receive operation return uint8_t |
Date: |
Tue, 20 Nov 2018 15:31:00 +0000 |
On 15 November 2018 at 19:24, <address@hidden> wrote:
> From: Corey Minyard <address@hidden>
>
> It is never supposed to fail and cannot return an error, so just
> have it return the proper type. Have it return 0xff on nothing
> available, since that's what would happen on a real bus.
>
> Signed-off-by: Corey Minyard <address@hidden>
This is a nice cleanup. There are some followups at
callsites of i2c_recv():
hw/arm/stellaris.c: s->mdr = i2c_recv(s->bus) & 0xff;
-- mask not needed
hw/i2c/aspeed_i2c.c: ret = i2c_recv(bus->bus);
hw/i2c/aspeed_i2c.c- if (ret < 0) {
hw/i2c/aspeed_i2c.c- qemu_log_mask(LOG_GUEST_ERROR, "%s: read
failed\n", __func__);
hw/i2c/aspeed_i2c.c- ret = 0xff;
-- error handling can be deleted
hw/i2c/exynos4210_i2c.c: ret = i2c_recv(s->bus);
hw/i2c/exynos4210_i2c.c- if (ret < 0 && (s->i2ccon & I2CCON_ACK_GEN)) {
hw/i2c/exynos4210_i2c.c- s->i2cstat |= I2CSTAT_LAST_BIT; /*
Data is not acknowledged */
-- ditto
hw/i2c/imx_i2c.c: ret = i2c_recv(s->bus);
hw/i2c/imx_i2c.c-
hw/i2c/imx_i2c.c- if (ret >= 0) {
hw/i2c/imx_i2c.c- imx_i2c_raise_interrupt(s);
-- condition now always-true
which should probably go in their own patch(es).
Reviewed-by: Peter Maydell <address@hidden>
thanks
-- PMM
- [Qemu-devel] [PATCH v2 04/12] i2c: Add a length check to the SMBus write handling, (continued)
[Qemu-devel] [PATCH v2 02/12] i2c: have I2C receive operation return uint8_t, minyard, 2018/11/15
- Re: [Qemu-devel] [PATCH v2 02/12] i2c: have I2C receive operation return uint8_t,
Peter Maydell <=
[Qemu-devel] [PATCH v2 05/12] i2c: Fix pm_smbus handling of I2C block read, minyard, 2018/11/15
[Qemu-devel] [PATCH v2 08/12] i2c: Add an SMBus vmstate structure, minyard, 2018/11/15
[Qemu-devel] [PATCH v2 07/12] i2c:pm_smbus: Fix state transfer, minyard, 2018/11/15
[Qemu-devel] [PATCH v2 06/12] boards.h: Ignore migration for SMBus devices on older machines, minyard, 2018/11/15