From 8702e88c20b5ecac07c26bdf5ddb6bc18e1f7ad9 Mon Sep 17 00:00:00 2001 From: "Tao,Zhang" Date: Mon, 23 Mar 2020 19:32:44 +0800 Subject: [PATCH] coresight: cti: Correct checking return value of device resume The return value of device resume function should be greater than or equal to 0. Correct the conditional judgment to allow the return value to be greater than 0. Otherwise, it can cause cti fail to pass test sometimes. Change-Id: I195b192d438b954c02c9d2cda2906075e8688ac9 Signed-off-by: Tao,Zhang --- drivers/hwtracing/coresight/coresight-cti.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-cti.c b/drivers/hwtracing/coresight/coresight-cti.c index 9ec2d152919f..81e8e9c15da4 100644 --- a/drivers/hwtracing/coresight/coresight-cti.c +++ b/drivers/hwtracing/coresight/coresight-cti.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. */ #include @@ -374,7 +374,7 @@ int coresight_cti_map_trigin(struct coresight_cti *cti, int trig, int ch) */ if (drvdata->refcnt == 0) { ret = pm_runtime_get_sync(drvdata->dev); - if (ret) + if (ret < 0) goto err1; ret = coresight_enable_reg_clk(drvdata->csdev); if (ret) @@ -465,7 +465,7 @@ int coresight_cti_map_trigout(struct coresight_cti *cti, int trig, int ch) */ if (drvdata->refcnt == 0) { ret = pm_runtime_get_sync(drvdata->dev); - if (ret) + if (ret < 0) goto err1; ret = coresight_enable_reg_clk(drvdata->csdev); if (ret) @@ -1459,7 +1459,7 @@ static int cti_init_save(struct cti_drvdata *drvdata, } if (drvdata->cti_save && !drvdata->cti_hwclk) { ret = pm_runtime_get_sync(drvdata->dev); - if (ret) + if (ret < 0) return ret; }