]> Git Repo - J-linux.git/commitdiff
watchdog: pm8916_wdt: Avoid read of write-only PET register
authorStephan Gerhold <[email protected]>
Wed, 29 Jun 2022 08:48:14 +0000 (10:48 +0200)
committerWim Van Sebroeck <[email protected]>
Sat, 23 Jul 2022 12:21:27 +0000 (14:21 +0200)
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 <[email protected]>
Reviewed-by: Loic Poulain <[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]>
drivers/watchdog/pm8916_wdt.c

index 0937b8d3310425b5a7efb81a7c091e711120a22b..670cd79f4cf961246adf782296e9aabbda328a4b 100644 (file)
@@ -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)
This page took 0.050404 seconds and 4 git commands to generate.