DEVICE_SHUTDOWN(9)

πŸ’– DEVICE_SHUTDOWN β€” the kernel dev manual, bestie edition πŸ’–

okay so you're reading DEVICE_SHUTDOWN(9) from the Kernel Developer's Manual and honestly? you're in the right place. pull up a chair πŸŽ€


✨ NAME ✨

DEVICE_SHUTDOWN β€” it gets called during system shutdown, no biggie πŸ’…


🌸 SYNOPSIS 🌸

#include <sys/param.h>
#include <sys/bus.h>

int
DEVICE_SHUTDOWN(device_t dev);

look at that signature. she's serving exactly one device_t and returning an int. iconic behavior, fr fr ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: the DEVICE_SHUTDOWN() method gets called during system shutdown. and why, you ask? because it lets the driver put the hardware into a consistent state for rebooting the computer 🫢

that's it. that's the whole job. your driver gets one last moment on stage before the machine goes night-night, and you better use it to leave the hardware in a state that won't be embarrassing on the way back up 😭

no cap: this is your driver's curtain call. handle it with the main character energy it deserves πŸ‘‘

πŸ’« RETURN VALUES πŸ’«

  • Zero β€” returned on success πŸŽ‰ slay
  • anything else β€” an error gets returned πŸ’€

that's the whole deal. zero = good, non-zero = not good. iykyk 🌈


🧚 SEE ALSO 🧚

go read the whole friend group, they're all connected besties πŸ’œ


πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Doug Rabson. king behavior, we love to see it πŸŽ€


and that's the whole page, bestie!! written on the Debian side of things, dated January 6, 2005, and yeah β€” that's genuinely the whole DEVICE_SHUTDOWN(9) situation. periodt. πŸ’–βœ¨

πŸ“¦ where this page comes from