summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2018-12-06 23:29:32 -0800
committerSascha Hauer <s.hauer@pengutronix.de>2018-12-10 09:53:09 +0100
commit3f326f9d0058174d2da92f31dbc176245386a4a6 (patch)
treef089cfb606b41048319f5b694a425c06e0c26453 /drivers/mfd
parent3224a21aa25bd99b4c72f581c3d76d65a7df8cd8 (diff)
downloadbarebox-3f326f9d0058174d2da92f31dbc176245386a4a6.tar.gz
barebox-3f326f9d0058174d2da92f31dbc176245386a4a6.tar.xz
mfd: rave-sp: Make use of wait_on_timeout()
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/rave-sp.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mfd/rave-sp.c b/drivers/mfd/rave-sp.c
index 469ce4cc0d..cc897b122f 100644
--- a/drivers/mfd/rave-sp.c
+++ b/drivers/mfd/rave-sp.c
@@ -314,7 +314,6 @@ int rave_sp_exec(struct rave_sp *sp,
unsigned char *data = __data;
int command, ret = 0;
u8 ackid;
- uint64_t start = get_time_ns();
command = sp->variant->cmd.translate(data[0]);
if (command < 0)
@@ -334,12 +333,9 @@ int rave_sp_exec(struct rave_sp *sp,
* is_timeout will implicitly poll serdev via poller
* infrastructure
*/
- while (!is_timeout(start, SECOND) && !reply.received)
- ;
-
- if (!reply.received) {
+ ret = wait_on_timeout(SECOND, reply.received);
+ if (ret) {
dev_err(dev, "Command timeout\n");
- ret = -ETIMEDOUT;
sp->reply = NULL;
}