mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
spi: rockchip-test: Check the spi sync actual length
Change-Id: I4a189c50cc9aa9c6151e9efcfa5eca59eb35f44a Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
@@ -74,7 +74,11 @@ int spi_write_slt(int id, const void *txbuf, size_t n)
|
||||
|
||||
spi_message_init(&m);
|
||||
spi_message_add_tail(&t, &m);
|
||||
return spi_sync(spi, &m);
|
||||
ret = spi_sync(spi, &m);
|
||||
if (m.actual_length && m.actual_length != n)
|
||||
pr_err("%s len=%d actual_length=%d\n", __func__, n, m.actual_length);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int spi_read_slt(int id, void *rxbuf, size_t n)
|
||||
@@ -99,7 +103,11 @@ int spi_read_slt(int id, void *rxbuf, size_t n)
|
||||
|
||||
spi_message_init(&m);
|
||||
spi_message_add_tail(&t, &m);
|
||||
return spi_sync(spi, &m);
|
||||
ret = spi_sync(spi, &m);
|
||||
if (m.actual_length && m.actual_length != n)
|
||||
pr_err("%s len=%d actual_length=%d\n", __func__, n, m.actual_length);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int spi_write_then_read_slt(int id, const void *txbuf, unsigned n_tx,
|
||||
|
||||
Reference in New Issue
Block a user