event_device_probe(9)
π event_device_probe(9) π
ok so bestie, welcome to the Kernel API Manual, section 9 β this is the page for event_device_probe, and honestly? it's giving "small function, big responsibilities." let's get into it π
β¨ NAME β¨
event_device_probe β the callback that fires when a brand-new device is being created. literally the "hi bestie welcome to the world" moment for a device πΈ
β¨ SYNOPSIS β¨
int event_device_probe (struct platform_device *pdev );
β¨ ARGUMENTS β¨
pdevβ the platform device that we will be receiving events from. that's our girl π«Ά she's the one feeding us the events.
β¨ DESCRIPTION β¨
okay so here's the vibe: this function goes and finds a free minor number for the device, then allocates and initializes some device data, and finally creates a new device and a char dev node. three-step glow-up, no cap β¨
now the important part β the device data gets freed in free_device_data, and that gets called when dev_data->dev is released. and when does that happen? only after all references to dev_data->dev are dropped. and that, bestie, happens once both of these things have gone down:
event_device_removehas been called, and- every opened file descriptor has been released.
so yeah β both conditions, not one. don't come for me, that's just how the lifecycle works ππ
β¨ RETURN β¨
0on success π- a negative error code on failure π
β¨ SEE ALSO β¨
- Kernel file
./drivers/platform/chrome/wilco_ec/event.c struct ec_event(9)struct ec_event_queue(9)struct event_device_data(9)enqueue_events(9)event_device_notify(9)event_read(9)free_device_data(9)
go read them, iykyk π
and that's the whole page, bestie π
this lil gem comes to you from ./drivers/platform/chrome/wilc... (yes that's the source line, truncated exactly like that, i don't make the rules π« ) and it's dated October 2026 β so go forth, probe those devices, and slay πβπ
π¦ 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