metootxy

导航

 

或许在驱动中,你可以经常看到id_table这个变量,那么它是用来干什么的呢?

 

首先,设备模型很清楚了吧,设备,驱动和总线之间的各种拉扯,我们都很清楚一个设备只能有一个驱动,但是驱动不会那么专一,他可以同时支持几个设备;

这下知道了id_table的作用了吧。他就是用来让绑定设备和驱动的。

如在include/linux/i2c.h中就有:

74         const struct i2c_device_id *id_table;
@id_table: List of I2C devices supported by this driver

 

posted on 2013-06-17 19:22  metootxy  阅读(2716)  评论(0)    收藏  举报