Skip to content

Commit b3ac0c5

Browse files
YuuoniyWim Van Sebroeck
authored andcommitted
watchdog: rti-wdt: Fix pm_runtime_get_sync() error checking
If the device is already in a runtime PM enabled state pm_runtime_get_sync() will return 1, so a test for negative value should be used to check for errors. Fixes: 2d63908 ("watchdog: Add K3 RTI watchdog support") Signed-off-by: Miaoqian Lin <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent 26d14b9 commit b3ac0c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/watchdog/rti_wdt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static int rti_wdt_probe(struct platform_device *pdev)
226226

227227
pm_runtime_enable(dev);
228228
ret = pm_runtime_get_sync(dev);
229-
if (ret) {
229+
if (ret < 0) {
230230
pm_runtime_put_noidle(dev);
231231
pm_runtime_disable(&pdev->dev);
232232
return dev_err_probe(dev, ret, "runtime pm failed\n");

0 commit comments

Comments
 (0)