platform_de...ister_simple(9)
π platform_device_register_simple β¨
okay so welcome to the Kernel API Manual bestie, this is platform_device_register_simple(9) and it's literally the shortcut for adding a platform-level device and its resources at the same time π
πΈ NAME πΈ
platform_device_register_simple β add a platform-level device and its resources π«Ά
β¨ SYNOPSIS β¨
struct platform_device * platform_device_register_simple (const char
*name , int id , const struct resource *res , unsigned int num );
π¦ ARGUMENTS π¦
nameβ the base name of the device we're adding πidβ the instance id, like which one of these cuties this is π₯resβ the set of resources that needs to be allocated for the device, iconicnumβ number of resources, yes bestie you have to count them π
π DESCRIPTION π
So this function creates a simple platform device that requires minimal resource and memory management, which is the whole appeal honestly π It comes with a canned release function that frees the memory allocated for the device, and that means drivers using such devices can be unloaded without waiting for the last reference to the device to be dropped π§ no cap, that's the good part.
This interface is primarily intended for use with legacy drivers which probe hardware directly β Like, that's its whole lane. And here's why: because such drivers create sysfs device nodes themselves, rather than letting system infrastructure handle such device enumeration tasks, they don't fully conform to the Linux driver model π In particular β and this is the part you need to remember β when such drivers are built as modules, they can't be "hotplugged" π
Returns struct platform_device pointer on success, or ERR_PTR on error π
ngl that ERR_PTR bit matters, bestie β check your return value, don't just vibe forward π
π«Ά SEE ALSO π«Ά
- Kernel file
./include/linux/platform_device.hstructplatform_device_info(9) platform_device_register_resndata(9)platform_device_register_data(9)
okay that's the whole page, you ate that π this little beauty lives in ./include/linux, dated October 2026, and it's platform_de...ister_simple(9) in the Kernel API Manual forever and always πβ¨π¦
π¦ 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