[PATCH linux-next] thermal/drivers/k3_j72xx_bandgap:using the pm_runtime_resume_and_get to simplify the code

From: cgel . zte
Date: Sun Jul 31 2022 - 22:38:39 EST


From: ye xingchen <ye.xingchen@xxxxxxxxxx>

Using pm_runtime_resume_and_get() to instade of pm_runtime_get_sync
and pm_runtime_put_noidle.

Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
Signed-off-by: ye xingchen <ye.xingchen@xxxxxxxxxx>
---
drivers/thermal/k3_j72xx_bandgap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c
index 115a44eb4fbf..5aabb89cf46d 100644
--- a/drivers/thermal/k3_j72xx_bandgap.c
+++ b/drivers/thermal/k3_j72xx_bandgap.c
@@ -403,9 +403,8 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
workaround_needed = driver_data->has_errata_i2128;

pm_runtime_enable(dev);
- ret = pm_runtime_get_sync(dev);
+ ret = pm_runtime_resume_and_get(dev);
if (ret < 0) {
- pm_runtime_put_noidle(dev);
pm_runtime_disable(dev);
return ret;
}
--
2.25.1