Linux Platform Device/driver (iii)--platform device and Platform_driver registration process code Comparison

Source: Internet
Author: User

Transferred from: http://blog.csdn.net/thl789/article/details/6723350

In the Linux 2.6 device-driven model, all devices are connected by bus. Device_register ()/Driver_register () executes the binding by enumerating the Driver/device on the bus, this article describes the process. This is the basis of the entire Linux device driver, platform devices, devices such as I²c's registration is ultimately called the registration function described in this article to achieve.

the registration of Linux device is finally realized through Device_register (), and driver's registration is finally realized through Driver_register () . The registration process for device and driver is illustrated in comparison.

The above diagram at a glance, the detailed process no longer repeat. Note the following remarks:

      • The p->drivers_autoprobe;1 of bus is true by default.
      • Bus_for_each_drv () is a __device_attach () operation on all driver on the bus, andBus_for_each_dev() is also a __driver_attach () operation on all device on the bus.
      • The . Match () function implemented on the bus that defines the rules for device and driver binding. Platform, for example, is to compare id_table first and then compare the rules for name. If the bus's match () function is not implemented, it is assumed that all the device and driver on the bus are match, and the specific follow-up process depends on the implementation of probe ().
      • probe rule is : if the bus on the realization of probe on the bus probe, otherwise will be used driver probe.

device is generally registered before driver , but it is not all in this order. The registration process for Linux device and driver enumerates all driver and device hooks on the bus, respectively, to achieve this timing independence.

Linux Platform Device/driver (iii)--platform device and Platform_driver registration process code Comparison

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.