functions: Rewrite wait_latency() function

Improve the logic on finding the sampling_rate. If
the sampling_rate cannot be found at all, return 1.

Signed-off-by: Lisa Nguyen <lisa.nguyen@linaro.org>
1 file changed