device_lock_set_class(9)
π 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:
struct subsys_interface(9)struct device_attribute(9)struct dev_ext_attribute(9)DEVICE_ATTR(9)DEVICE_ATTR_RW(9)DEVICE_ATTR_ADMIN_RW(9)DEVICE_ATTR_RW_NAMED(9)DEVICE_ATTR_RO(9)DEVICE_ATTR_ADMIN_RO(9)DEVICE_ATTR_RO_NAMED(9)DEVICE_ATTR_WO(9)DEVICE_ATTR_WO_NAMED(9)DEVICE_ULONG_ATTR(9)DEVICE_INT_ATTR(9)DEVICE_BOOL_ATTR(9)DEVICE_STRING_ATTR_RO(9)enum device_link_state(9)enum dl_dev_state(9)enum device_removable(9)struct dev_links_info(9)struct dev_msi_info(9)enum device_physical_location_panel(9)enum device_physical_location_vertical_position(9)enum device_physical_location_horizontal_position(9)struct device_physical_location(9)enum struct_device_flags(9)struct device(9)struct device_link(9)device_set_driver_override(9)device_has_driver_override(9)device_match_driver_override(9)device_iommu_mapped(9)dev_name(9)dev_bus_name(9)device_find_child_by_name(9)device_find_any_child(9)device_lock_reset_class(9)
π§ friendly reminder:device_lockheld first, and only the defaultlockdep_no_validateclass 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
- 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