What is the sequence followed by the Linux kernel to configure a device?

Posted by Jaime Soriano on Stack Overflow See other posts from Stack Overflow or by Jaime Soriano
Published on 2010-06-01T19:05:15Z Indexed on 2010/06/01 19:14 UTC
Read the original article Hit count: 446

As I understood after reading the chapter related to The Linux Device Model in the Linux Device Drivers 3rd Edition, when a new device is configured, the kernel follows more or less this sequence:

  1. The Device is registered in the driver core (device_register(), what includes device initialization)
  2. A kobject is registered in the device model
  3. It provokes a hotplug event
  4. Bus and drivers are checked to see which one matches with the device
  5. Probe
  6. Device is binded to the driver

My main doubt is, in step 1, when is device_register() called and what info should be yet in the device struct?

Is it called by the bus to which the device is connected? Any example in the code?

Have I misunderstood something? :)

© Stack Overflow or respective owner

Related posts about linux

Related posts about linux-kernel