Conceptual
Login

How Linux Binds a Driver to a Device

Linux keeps two lists per bus: devices that exist and drivers that have registered. When either list changes it tries to match them using the driver's table of supported identifiers, and on a match it calls the driver's probe function, handing over the device; when the device goes away or the driver is unloaded it calls remove. This is why a driver has no main function and never searches for hardware itself, and why everything your driver sets up must be torn down again in the right order.

Questions this Concept answers

  • Why does a Linux driver have no main function and never search for its hardware itself?