watchdog_init_timeout(9)
π watchdog_init_timeout(9)
okay so this is a page from the Kernel API Manual β yes bestie, the kernel has lore too β and it's all about watchdog_init_timeout, which lowkey just sets up the timeout field for you. cute, right? πΆβ¨
πΈ NAME πΈ
watchdog_init_timeout β literally just initialize the timeout field. that's the whole job. iconic of it, honestly. π
β¨ SYNOPSIS β¨
int watchdog_init_timeout (struct watchdog_device *wdd , unsigned int
timeout_parm , const struct device *dev );
so you're calling it with three things and it hands you back an int. slay. π«Ά
π ARGUMENTS π
wddβ the watchdog device itself. the main character of this whole situation. πtimeout_parmβ the timeout module parameter. think of it as the "what the user asked for" option. βdevβ the device that stores thetimeout-secproperty. that's where the backup answer lives. π¦
π DESCRIPTION π
so here's the vibe check: this function initializes the timeout field of the watchdog_device struct, and it's got two sources to pull from. π
it takes either:
- the timeout module parameter β but only if it's a valid value, or
- the
timeout-secproperty β but only if that's a valid value andtimeout_parmis out of bounds.
and if neither of them is valid? then we just keep the old value. and ngl that old value should normally be the default timeout value, so it all works out. π§
β οΈ heads up bestie β for the module parameter, '0' means it should simply be dropped if you want to use the default value. that's just how it is. don't come for me, i don't make the rules. π
return-wise: a zero comes back on success, or -EINVAL if literally all the provided values are out of bounds. not me getting rejected by every single validation check ππ
π₯ SEE ALSO π₯
- Kernel file
./drivers/watchdog/watchdog_core.cβ go read the source, iykwim β¨ watchdog_set_restart_priority(9)watchdog_register_device(9)watchdog_unregister_device(9)devm_watchdog_register_device(9)
all of these are absolutely part of the watchdog cinematic universe ππ
and that's the whole page, bestie! πΈ this masterpiece lives under ./drivers/watchdog and it's dated October 2026 β so yeah, future vibes fr fr. go forth and initialize those timeouts πππ¦π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms