diff options
| author | Tim Harvey <[email protected]> | 2022-03-24 08:32:00 -0700 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2022-03-31 08:27:51 -0400 |
| commit | 051df08fe072c3790c159d7b9966513325eb04ec (patch) | |
| tree | ec17dfaa9fb3431312dae1d6841bd2f7aea08489 | |
| parent | 0c60b657d8455784a58bfe08acff66a43dfccaad (diff) | |
board: gw_ventana: gsc: fix GSC read/write functions
commit 7c84319af9c7 ("dm: gpio: Correct use of -ENODEV in drivers")
changed the return code for an I2C NAK from -ENODEV to -EREMOTEIO.
Update the gsc_i2c_read and gsc_i2c_write functions for this change
to properly retry the transaction on a NAK meaning the GSC is busy.
Fixes: 7c84319af9c7 ("dm: gpio: Correct use of -ENODEV in drivers")
Signed-off-by: Tim Harvey <[email protected]>
Reviewed-by: Fabio Estevam <[email protected]>
| -rw-r--r-- | board/gateworks/gw_ventana/gsc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/board/gateworks/gw_ventana/gsc.c b/board/gateworks/gw_ventana/gsc.c index 324e5dbed2c..a5d6de7e0e8 100644 --- a/board/gateworks/gw_ventana/gsc.c +++ b/board/gateworks/gw_ventana/gsc.c @@ -41,7 +41,7 @@ int gsc_i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len) break; debug("%s: 0x%02x 0x%02x retry%d: %d\n", __func__, chip, addr, n, ret); - if (ret != -ENODEV) + if (ret != -EREMOTEIO) break; mdelay(10); } @@ -60,7 +60,7 @@ int gsc_i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len) break; debug("%s: 0x%02x 0x%02x retry%d: %d\n", __func__, chip, addr, n, ret); - if (ret != -ENODEV) + if (ret != -EREMOTEIO) break; mdelay(10); } |
