summary refs log tree commit diff
path: root/drivers/watchdog/pm8916_wdt.c
diff options
context:
space:
mode:
authorStephan Gerhold <stephan.gerhold@kernkonzept.com>2022-06-29 10:48:14 +0200
committerWim Van Sebroeck <wim@linux-watchdog.org>2022-07-23 14:21:27 +0200
commit4e5b406514fce00b16b7fc8cc5a6c9ec51518b0a (patch)
tree06e7542e27942743f846e6153e436fcee52b71e6 /drivers/watchdog/pm8916_wdt.c
parent5f02d033f3a512397e2304c3cd0c0d69471e5338 (diff)
downloadlinux-4e5b406514fce00b16b7fc8cc5a6c9ec51518b0a.tar.gz
watchdog: pm8916_wdt: Avoid read of write-only PET register
PMIC_WD_RESET_PET is a write-only register that is used to ping
the watchdog. It does not make sense to use read-modify-write
for it: a register read will never return anything but zero.
(And actually even if it did we would still want to write again
to ensure the watchdog is pinged.)

Reduce the overhead for the watchdog ping slightly by using
regmap_write() directly instead.

Signed-off-by: Stephan Gerhold <stephan.gerhold@kernkonzept.com>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20220629084816.125515-2-stephan.gerhold@kernkonzept.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Diffstat (limited to 'drivers/watchdog/pm8916_wdt.c')
-rw-r--r--drivers/watchdog/pm8916_wdt.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/watchdog/pm8916_wdt.c b/drivers/watchdog/pm8916_wdt.c
index 0937b8d33104..670cd79f4cf9 100644
--- a/drivers/watchdog/pm8916_wdt.c
+++ b/drivers/watchdog/pm8916_wdt.c
@@ -58,9 +58,8 @@ static int pm8916_wdt_ping(struct watchdog_device *wdev)
 {
 	struct pm8916_wdt *wdt = watchdog_get_drvdata(wdev);
 
-	return regmap_update_bits(wdt->regmap,
-				  wdt->baseaddr + PON_PMIC_WD_RESET_PET,
-				  WATCHDOG_PET_BIT, WATCHDOG_PET_BIT);
+	return regmap_write(wdt->regmap, wdt->baseaddr + PON_PMIC_WD_RESET_PET,
+			    WATCHDOG_PET_BIT);
 }
 
 static int pm8916_wdt_configure_timers(struct watchdog_device *wdev)