__platform_driver_probe(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __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 __init section. 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:


πŸŽ€ 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