Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

watchdog: rzg2l_wdt: Use pm_runtime_resume_and_get()

pm_runtime_get_sync() may return with error. In case it returns with error
dev->power.usage_count needs to be decremented. pm_runtime_resume_and_get()
takes care of this. Thus use it.

Along with it the rzg2l_wdt_set_timeout() function was updated to
propagate the result of rzg2l_wdt_start() to its caller.

Fixes: 2cbc5cd0b55f ("watchdog: Add Watchdog Timer driver for RZ/G2L")
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20240531065723.1085423-4-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>

authored by

Claudiu Beznea and committed by
Wim Van Sebroeck
f0ba0fcd 9e69846c

+8 -3
+8 -3
drivers/watchdog/rzg2l_wdt.c
··· 123 123 static int rzg2l_wdt_start(struct watchdog_device *wdev) 124 124 { 125 125 struct rzg2l_wdt_priv *priv = watchdog_get_drvdata(wdev); 126 + int ret; 126 127 127 - pm_runtime_get_sync(wdev->parent); 128 + ret = pm_runtime_resume_and_get(wdev->parent); 129 + if (ret) 130 + return ret; 128 131 129 132 /* Initialize time out */ 130 133 rzg2l_wdt_init_timeout(wdev); ··· 153 150 154 151 static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int timeout) 155 152 { 153 + int ret = 0; 154 + 156 155 wdev->timeout = timeout; 157 156 158 157 /* ··· 164 159 */ 165 160 if (watchdog_active(wdev)) { 166 161 rzg2l_wdt_stop(wdev); 167 - rzg2l_wdt_start(wdev); 162 + ret = rzg2l_wdt_start(wdev); 168 163 } 169 164 170 - return 0; 165 + return ret; 171 166 } 172 167 173 168 static int rzg2l_wdt_restart(struct watchdog_device *wdev,