DEVICE_ATTR_WO(9)
π DEVICE_ATTR_WO(9) β bestie's guide to the kernel API manual β¨
okay so this one's from the Kernel API Manual (that's the manual name, keeping it cute and official up top π). Strap in, because this macro is short but it serves.
πΈ NAME πΈ
DEVICE_ATTR_WO β it defines an admin-only writable device attribute. That's it. That's the whole vibe. Write-only, admin-only, no reading, we don't do that here π
β¨ SYNOPSIS β¨
DEVICE_ATTR_WO (_name );
π¦ ARGUMENTS π¦
_nameβ the attribute name, literally the name of your attribute, that's the whole job π«Ά
π DESCRIPTION π
So it's like DEVICE_ATTR, bestie β same energy, same family β except the mode is hardcoded to 0200 and the store function is <_name>_store.
That's the whole tea β. 0200 means write-only for the owner, and <name>_store is the callback it generates for you. No cap, that's all this macro does, and honestly? Iconic. Let it be simple π₯
π SEE ALSO π
Everything below is straight from the kernel file ./include/linux/device.h, so go read these if you wanna go deeper, iykyk π
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_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_set_class(9)device_lock_reset_class(9)
no notes, the whole list is here, go click around, that's the assignment π§
and that's a wrap!! π this page lives at ./include/linux, dated October 2026 β mwah, slay, periodt, hope this helped bestie ππ
π¦ 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