crypto: sa2ul - Fix pm_runtime_get_sync() error checking
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 9 Sep 2020 09:45:28 +0000 (12:45 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 18 Sep 2020 07:20:10 +0000 (17:20 +1000)
The pm_runtime_get_sync() function returns either 0 or 1 on success but
this code treats a return of 1 as a failure.

Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/sa2ul.c

index 934e9a0..a0b398a 100644 (file)
@@ -2327,7 +2327,7 @@ static int sa_ul_probe(struct platform_device *pdev)
 
        pm_runtime_enable(dev);
        ret = pm_runtime_get_sync(dev);
-       if (ret) {
+       if (ret < 0) {
                dev_err(&pdev->dev, "%s: failed to get sync: %d\n", __func__,
                        ret);
                return ret;