Skip to content

Commit 4e5b406

Browse files
stephan-ghWim Van Sebroeck
authored andcommitted
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 <[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]>
1 parent 5f02d03 commit 4e5b406

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/watchdog/pm8916_wdt.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ static int pm8916_wdt_ping(struct watchdog_device *wdev)
5858
{
5959
struct pm8916_wdt *wdt = watchdog_get_drvdata(wdev);
6060

61-
return regmap_update_bits(wdt->regmap,
62-
wdt->baseaddr + PON_PMIC_WD_RESET_PET,
63-
WATCHDOG_PET_BIT, WATCHDOG_PET_BIT);
61+
return regmap_write(wdt->regmap, wdt->baseaddr + PON_PMIC_WD_RESET_PET,
62+
WATCHDOG_PET_BIT);
6463
}
6564

6665
static int pm8916_wdt_configure_timers(struct watchdog_device *wdev)

0 commit comments

Comments
 (0)