create_pnp_modalias(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ create_pnp_modalias ✨

okay so bestie, welcome to create_pnp_modalias(9) β€” a little function from the Kernel API Manual that literally builds hid/cid(s) strings for modalias and uevent. it's giving humble-but-essential, fr fr πŸ’…


🌸 SYNOPSIS 🌸

int create_pnp_modalias (const struct acpi_device *acpi_dev , char
*modalias , int size );

πŸŽ€ ARGUMENTS πŸŽ€

  • acpi_dev β€” the ACPI device object in question. the main character of this whole operation 🫢
  • modalias β€” the buffer you're printing into. this is where the string goes, no cap.
  • size β€” the size of that buffer. gotta know your limits, bestie ✨

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does it actually do? it creates the hid/cid(s) string that's needed for modalias and uevent. iconic behaviour, honestly.

like, for example β€” on a device with hid:IBM0001 and cid:ACPI0001, you get:

char *modalias: "acpi:IBM0001:ACPI0001"

that's it, that's the whole vibe. the string just gets assembled and printed into your buffer. lowkey elegant 🌈


πŸ’– RETURN πŸ’–

  • 0 β€” no _HID and no _CID
  • -EINVAL β€” output error
  • -ENOMEM β€” output is truncated
πŸ’€ pay attention to that last one: if your buffer is too small, you get -ENOMEM and the output is truncated. size matters, bestie, that's why size is right there in the argument list πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

all the sibling functions, the whole friend group 🫢 go read them, iykyk.


⭐ that's the page!! sourced from the ./drivers/acpi directory, dated October 2026, and yes, create_pnp_modalias(9) is the name of the game. periodt. πŸŽ€πŸ’œ

πŸ“¦ where this page comes from