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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Oct 2016 10:14:00 +0000 (04:14 -0600)
commit1ea1d49d1630c1617cd04489faf419b0aeb18bfa
treeb80f79030db1efce7f44abf951ccd5c5ef66a09f
parent2b1309856d5b4604bf0aaa403ee674fe6a6880d6
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/hw_random/omap-rng.c