__platform_driver_probe(9)
π
__platform_driver_probe (9) β Kernel API Manual, but make it make sense
Okay bestie, gather round, because this one is a kernel-API-manual page and we are going to read it together. It's __platform_driver_probe from the Kernel API Manual, and it's literally about registering a driver for a device that is not hotpluggable. Yes, the double-underscore is part of the name. No, we do not ask why. π«Ά
β¨ NAME β¨
__platform_driver_probe β register a driver for a non-hotpluggable device. That's the whole vibe. π
πΈ SYNOPSIS πΈ
int __platform_driver_probe (struct platform_driver *drv , int
(*probe)(struct platform_device *) , struct module *module , const char
*mod_name );
Four arguments, one int coming back at you. Iconic signature, no notes. π
π¦ ARGUMENTS π¦
drvβ the platform driver structure. This is the driver's whole little identity card. πprobeβ the driver's probe routine, probably coming from an__initsection. It's giving "runs once, then we yeet it."moduleβ the module that will be the owner of the driver. Somebody has to claim it.mod_nameβ the module name string. Literally just the name, as a string. π
π DESCRIPTION π
Use this one instead of platform_driver_register when you know two things: the device is not hotpluggable, and it has already been registered β and you also want its run-once probe infrastructure removed from memory after the driver has bound to that device. That's the entire point, bestie. Memory said "not today," so we clean up after ourselves. β¨
One typical use for this would be with drivers for controllers that are integrated into system-on-chip processors, where the controller devices have been configured as part of board setup. Very "built in from the start," very main-character energy. π
β οΈ Heads up, and this is important: this is incompatible with deferred probing. Not "kind of awkward with." Incompatible. No cap. π
Returns: zero if the driver registered and bound to a device. Otherwise it returns a negative error code, and the driver is not registered. So a nonzero return means nothing happened at all β good to know, iykyk. π§
π SEE ALSO π
Kernel file ./drivers/base/platform.c and the whole platform-crew, fr fr β here's every single one:
platform_get_resource(9)devm_platform_get_and_ioremap_resource(9)devm_platform_ioremap_resource(9)devm_platform_ioremap_resource_byname(9)platform_get_irq_affinity(9)platform_get_irq_optional(9)platform_get_irq(9)platform_irq_count(9)devm_platform_get_irqs_affinity(9)platform_get_resource_byname(9)platform_get_irq_byname(9)platform_get_irq_byname_optional(9)platform_add_devices(9)platform_device_put(9)platform_device_alloc(9)platform_device_add_resources(9)platform_device_add_data(9)platform_device_set_of_node(9)platform_device_set_fwnode(9)platform_device_set_of_node_from_dev(9)platform_device_add(9)platform_device_del(9)platform_device_register(9)platform_device_unregister(9)platform_device_register_full(9)__platform_driver_register(9)platform_driver_unregister(9)__platform_create_bundle(9)__platform_register_drivers(9)platform_unregister_drivers(9)platform_match(9)platform_find_device_by_driver(9)
π Sign-off π
That's the whole page, bestie β it lives over in ./drivers/base, and this edition is dated October 2026. Go forth and register your non-hotpluggable devices responsibly, and remember: no deferred probing. 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