create_pnp_modalias(9)
β¨ 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_HIDand no_CID-EINVALβ output error-ENOMEMβ output is truncated
π pay attention to that last one: if your buffer is too small, you get-ENOMEMand the output is truncated. size matters, bestie, that's whysizeis right there in the argument list π
π SEE ALSO π
- Kernel file
./drivers/acpi/device_sysfs.c create_of_modalias(9)acpi_device_uevent_modalias(9)acpi_device_modalias(9)acpi_device_setup_files(9)acpi_device_remove_files(9)
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
- 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