device_lock_set_class(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– device_lock_set_class(9) πŸ’–

okay so bestie, we're in the Kernel API Manual today and this one is short but mighty β€” it's the page for device_lock_set_class, and yes it's giving "tiny function, big lockdep energy." 🫢


✨ NAME ✨

device_lock_set_class β€” specify a temporary lock class while a device is attached to a driver πŸ’…


🌸 SYNOPSIS 🌸

device_lock_set_class (dev , key );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device you're modifying, bestie. the main character of this call πŸ¦‹
  • key β€” the lock class key data. that's the vibe-check payload πŸ”‘

πŸ’œ DESCRIPTION πŸ’œ

okay so listen. this must be called with the device_lock already held β€” like, no cap, that lock is already in your hand when you call this. the classic spot is from driver ->probe. ⭐

and pls be careful: only override the default lockdep_no_validate class. that's the rule, that's the assignment, don't be out here overriding random classes fr fr. πŸ™ˆ


🌈 SEE ALSO 🌈

the whole extended friend group πŸ’– β€” kernel file ./include/linux/device.h plus these icons:


🧚 friendly reminder: device_lock held first, and only the default lockdep_no_validate class gets overridden. that's the whole assignment, slay it correctly. πŸ’€βœ¨

and that's a wrap! this lil page lives in ./include/linux and it's dated October 2026 β€” so yeah, timestamps from the future, we love a forward-thinking icon πŸ‘‘πŸ’… no cap, periodt.

πŸ“¦ where this page comes from