STRUCT PLATFORM_DEVICE_INFO(9)
π¦ struct platform_device_info(9) π¦
hii bestie π welcome to the Kernel API Manual β this page is all about struct platform_device_info, aka the lil parameter bundle that tells the kernel how to build a platform device. no cap, it's giving "paperwork for device creation" but make it iconic.
β¨ NAME β¨
struct platform_device_info β the set of parameters for creating a platform device. literally the blueprint, bestie π
π SYNOPSIS π
struct platform_device_info {
struct device *parent;
struct fwnode_handle *fwnode;
bool of_node_reused;
const char *name;
int id;
const struct resource *res;
unsigned int num_res;
const void *data;
size_t size_data;
u64 dma_mask;
const struct software_node *swnode;
const struct property_entry *properties;
};
πΈ Members πΈ
okay so here's the whole cast of characters, one by one π
parentβ the parent device for the new platform device. family tree vibes π³fwnodeβ the firmware node associated with the device.of_node_reusedβ says that the device tree node associated with the device is shared with another device, typically its ancestor. Setting this totrueprevents the device from being matched via the OF match table, and stops the device core from automatically binding pinctrl configuration to avoid disrupting the other device. very "shared custody" energy, but for device tree nodes πnameβ name of the device.idβ instance ID of the device. UsePLATFORM_DEVID_NONEif there is only one instance of the device, orPLATFORM_DEVID_AUTOto let the kernel automatically assign a unique instance ID. pick your fighter β¨resβ set of resources to attach to the device.num_resβ number of entries inres.dataβ device-specific data for this platform device.size_dataβ size of device-specific data.dma_maskβ DMA mask for the device.swnodeβ a secondary software node to be attached to the device. The node will be automatically registered and its lifetime tied to the platform device if it is not registered yet. automatic registration + tied lifetime? she's independent but attached, we love to see it π¦propertiesβ a set of software properties for the device. If provided, a managed software node will be automatically created and assigned to the device. The properties array must be terminated with a sentinel entry. Specifying bothpropertiesandswnodeis not allowed. π¨
bestie, fr fr: don't try to pass bothpropertiesandswnodeβ that combo is not allowed.
π Description π
This structure is used to hold information needed to create and register a platform device using platform_device_register_full. it's the info packet, and platform_device_register_full is the main character doing the actual registration π₯
platform_device_register_full makes deep copies of name, res, data and properties, so the caller does not need to keep them after registration. meaning you can hand over your stuff and move on, no lingering attachment π
If the registration is performed during initialization, these can be marked as __initconst. cute lil optimization for init-time setup, periodt β¨
π SEE ALSO π
- Kernel file
./include/linux/platform_device.h platform_device_register_resndata(9)platform_device_register_simple(9)platform_device_register_data(9)
go read those too, bestie, the lore is deep ππ
mwah π this adorable page came from ./include/linux, dated October 2026, and it's literally the struct platform_device_info(9) page. bye bestie, slay your platform devices responsibly π«Άπ
π¦ 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