diff options
| author | Nicholas Mc Guire <hofrat@osadl.org> | 2015-02-09 12:21:05 -0500 |
|---|---|---|
| committer | Sebastian Reichel <sre@kernel.org> | 2015-02-25 16:47:12 -0500 |
| commit | 298631e1ecad278f9d442062035d29d9787b6994 (patch) | |
| tree | 68fd3d45270b14af8d8fb56f3f41871312b71e02 /drivers/power | |
| parent | 5ae6e2a8f8008dffec3f9d48337ba0bc430a1211 (diff) | |
ab8500_fg: use jiffies_to_msecs for jiffies conversion
Converting jiffies to milliseconds by "val * 1000 / HZ" is technically
OK but jiffies_to_msecs(val) is the cleaner solution and handles all
corner cases correctly. This is a minor API consolidation only and
should make things more readable.
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power')
| -rw-r--r-- | drivers/power/ab8500_fg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c index 73288dac0521..40344e01df80 100644 --- a/drivers/power/ab8500_fg.c +++ b/drivers/power/ab8500_fg.c | |||
| @@ -629,7 +629,7 @@ int ab8500_fg_inst_curr_finalize(struct ab8500_fg *di, int *res) | |||
| 629 | &di->ab8500_fg_complete, | 629 | &di->ab8500_fg_complete, |
| 630 | INS_CURR_TIMEOUT); | 630 | INS_CURR_TIMEOUT); |
| 631 | dev_dbg(di->dev, "Finalize time: %d ms\n", | 631 | dev_dbg(di->dev, "Finalize time: %d ms\n", |
| 632 | ((INS_CURR_TIMEOUT - timeout) * 1000) / HZ); | 632 | jiffies_to_msecs(INS_CURR_TIMEOUT - timeout)); |
| 633 | if (!timeout) { | 633 | if (!timeout) { |
| 634 | ret = -ETIME; | 634 | ret = -ETIME; |
| 635 | disable_irq(di->irq); | 635 | disable_irq(di->irq); |
| @@ -731,7 +731,7 @@ int ab8500_fg_inst_curr_blocking(struct ab8500_fg *di) | |||
| 731 | &di->ab8500_fg_started, | 731 | &di->ab8500_fg_started, |
| 732 | INS_CURR_TIMEOUT); | 732 | INS_CURR_TIMEOUT); |
| 733 | dev_dbg(di->dev, "Start time: %d ms\n", | 733 | dev_dbg(di->dev, "Start time: %d ms\n", |
| 734 | ((INS_CURR_TIMEOUT - timeout) * 1000) / HZ); | 734 | jiffies_to_msecs(INS_CURR_TIMEOUT - timeout)); |
| 735 | if (!timeout) { | 735 | if (!timeout) { |
| 736 | ret = -ETIME; | 736 | ret = -ETIME; |
| 737 | dev_err(di->dev, "completion timed out [%d]\n", | 737 | dev_err(di->dev, "completion timed out [%d]\n", |
