platform/x86: intel_atomisp2_pm: Refactor timeout loop
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 9 Jan 2020 14:08:25 +0000 (16:08 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 10 Jan 2020 09:57:22 +0000 (11:57 +0200)
commit81bda12aad60b0dc9f76f6f7a575d7b812533a19
tree48f95d1f8a281f2aa31153b122852c6642975365
parenta28215844d8db87aadb9bcce040e7897691ff6ba
platform/x86: intel_atomisp2_pm: Refactor timeout loop

The timeout loop look more naturally when done like

unsigned long timeout = ...;
...
do {
...
if (cond)
return %OK;

sleep(...);
} while (time_before(timeout));

...print timeout error...
return %ERROR;

It also saves LOCs. Convert the driver to this format of timeout loop.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/intel_atomisp2_pm.c