diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2016-06-22 14:46:40 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-06-24 16:03:28 -0700 |
commit | dbb8cfeba9cc22e091eaec3dfa34ae4c7dc4d241 (patch) | |
tree | 20e4dbb72f753691bfc15d6860011b3e43d4f081 /drivers/staging/greybus/bootrom.c | |
parent | a4293e1d4e6416477976ee3bd248589d3fc4bb19 (diff) |
greybus: bootrom: send timeout in milliseconds to gb_bootrom_set_timeout()
Rename NEXT_REQ_TIMEOUT_J to NEXT_REQ_TIMEOUT_MS and store the timeout
in milliseconds instead of jiffies.
Suggested-by: Alex Elder <alex.elder@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/bootrom.c')
-rw-r--r-- | drivers/staging/greybus/bootrom.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/greybus/bootrom.c b/drivers/staging/greybus/bootrom.c index 6d79bc6388df..70785d4b64a9 100644 --- a/drivers/staging/greybus/bootrom.c +++ b/drivers/staging/greybus/bootrom.c @@ -15,7 +15,7 @@ #include "greybus.h" /* Timeout, in jiffies, within which the next request must be received */ -#define NEXT_REQ_TIMEOUT_J msecs_to_jiffies(1000) +#define NEXT_REQ_TIMEOUT_MS 1000 enum next_request_type { NEXT_REQ_FIRMWARE_SIZE, @@ -82,7 +82,7 @@ static void gb_bootrom_set_timeout(struct gb_bootrom *bootrom, enum next_request_type next, unsigned long timeout) { bootrom->next_request = next; - schedule_delayed_work(&bootrom->dwork, timeout); + schedule_delayed_work(&bootrom->dwork, msecs_to_jiffies(timeout)); } /* @@ -211,7 +211,7 @@ unlock: queue_work: /* Refresh timeout */ gb_bootrom_set_timeout(bootrom, NEXT_REQ_GET_FIRMWARE, - NEXT_REQ_TIMEOUT_J); + NEXT_REQ_TIMEOUT_MS); return ret; } @@ -281,7 +281,7 @@ queue_work: else next_request = NEXT_REQ_GET_FIRMWARE; - gb_bootrom_set_timeout(bootrom, next_request, NEXT_REQ_TIMEOUT_J); + gb_bootrom_set_timeout(bootrom, next_request, NEXT_REQ_TIMEOUT_MS); return ret; } @@ -327,7 +327,7 @@ queue_work: * connection. As that can take some time, increase the timeout a bit. */ gb_bootrom_set_timeout(bootrom, NEXT_REQ_MODE_SWITCH, - 5 * NEXT_REQ_TIMEOUT_J); + 5 * NEXT_REQ_TIMEOUT_MS); return ret; } @@ -447,7 +447,7 @@ static int gb_bootrom_probe(struct gb_bundle *bundle, /* Refresh timeout */ gb_bootrom_set_timeout(bootrom, NEXT_REQ_FIRMWARE_SIZE, - NEXT_REQ_TIMEOUT_J); + NEXT_REQ_TIMEOUT_MS); dev_dbg(&bundle->dev, "AP_READY sent\n"); |