acpi_set_modalias(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– acpi_set_modalias β€” a.k.a. the acpi_set_modalias(9) kernel API page, bestie edition πŸ’–

okay so this is a page from the Kernel API Manual and it's literally about setting a modalias. yes, that modalias. sit down, grab a strawberry, we're doing this πŸ“


✨ NAME ✨

acpi_set_modalias β€” set modalias using the "compatible" property or a supplied ID. that's it, that's the whole vibe. no cap. πŸ’…


🌸 SYNOPSIS 🌸

void acpi_set_modalias (struct acpi_device *adev , const char
*default_id , char *modalias , size_t len );

look at her. iconic signature. four params, void return, zero drama (until the buffer's too small, but that's a len problem, not ours πŸ™ˆ).


πŸŽ€ ARGUMENTS πŸŽ€

  • adev β€” the ACPI device object we're trying to match. this is the main character of the function, fr fr. πŸ‘‘
  • default_id β€” the ID string we fall back to if there's, like, no compatible string found. the backup bestie. 🫢
  • modalias β€” a pointer to the buffer where the modalias value gets copied into. it's giving "here's where the answer goes". ✨
  • len β€” the length of the modalias buffer. know your limits, babe. πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: this is the counterpart of of_alias_from_compatible for struct acpi_device objects. like, the ACPI version of that whole situation. πŸ’–

if there is a compatible string for adev, it gets copied into modalias β€” but with the vendor prefix stripped, okay? stripped. gone. not invited. βœ‚οΈβœ¨

otherwise β€” and this is the important bit β€” default_id will be used instead. so either way you're walking out of here with something in that buffer. slay. πŸ’…


🌈 SEE ALSO 🌈

the whole friend group, alive and well, living in the kernel file ./drivers/acpi/bus.c:

go read them. iykyk. πŸ“šπŸ¦‹


and that's the page!! πŸŽ€ this one lives in ./drivers/acpi, dated October 2026, and it's the acpi_set_modalias(9) entry in the Kernel API Manual. mwah. obsessed. bye bestie πŸ’œπŸŒΈ

πŸ“¦ where this page comes from