DEVICE_STRING_ATTR_RO(9)
π DEVICE_STRING_ATTR_RO π
okay bestie, welcome to the DEVICE_STRING_ATTR_RO(9)</p> page, straight outta the Kernel API Manual β¨ this one's short and sweet and honestly kind of a vibe.
β¨ NAME β¨
DEVICE_STRING_ATTR_RO β bestie. it defines a device attribute backed by a r/o string. that's it. that's the whole thing. π
π¦ SYNOPSIS π¦
DEVICE_STRING_ATTR_RO (_name , _mode , _var );
yes the spacing is Like That, we don't judge π
πΈ ARGUMENTS πΈ
_nameβ the attribute name, aka what this thing is called π_modeβ the file mode, you know the drill π_varβ the identifier of the string. it's a string. it's identified. slay π
π₯ DESCRIPTION π₯
okay so picture DEVICE_ULONG_ATTR, right? iconic. love her. this is literally that but _var is a string instead π¦
and here's the important part, no cap: because the length of the string allocation is unknown, the attribute must be read-only. like, that's not a suggestion, that's the whole reason the _RO is in the name. the vibe check said nope to writing π
bestie please don't try to make it writable. the allocation length is a mystery and we are Not doing that π
β SEE ALSO β
the whole fam, in the order the page gives them, because i would never do you dirty like that π«Ά
- Kernel file
./include/linux/device.hstructsubsys_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)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)
and that's the whole page, bestie, go forth and define your read-only string attributes π
sign-off time: this lil masterpiece lives in ./include/linux, it's dated October 2026, and it answers to the name DEVICE_STRING_ATTR_RO(9) πβ¨ bye 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