hwrng: omap - Only fail if pm_runtime_get_sync returns < 0
authorDave Gerlach <d-gerlach@ti.com>
Tue, 20 Sep 2016 15:25:40 +0000 (10:25 -0500)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Feb 2017 10:03:33 +0000 (11:03 +0100)
commit8e9a1e986a52f262d224cb3b08f7ea08f5ad3252
tree3b2903e38e49b77f197d7c748db99ca65e15a7c2
parent1ef0fbffc8c39ef08c7353241f81226e7a42c481
hwrng: omap - Only fail if pm_runtime_get_sync returns < 0

commit ad8529fde9e3601180a839867a8ab041109aebb5 upstream.

Currently omap-rng checks the return value of pm_runtime_get_sync and
reports failure if anything is returned, however it should be checking
if ret < 0 as pm_runtime_get_sync return 0 on success but also can return
1 if the device was already active which is not a failure case. Only
values < 0 are actual failures.

Fixes: 61dc0a446e5d ("hwrng: omap - Fix assumption that runtime_get_sync will always succeed")
Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/char/hw_random/omap-rng.c