用户空间控制驱动与设备的绑定与解绑

1.用户空间可以控制设备与驱动的绑定和解绑

/* include/linux/device.h */
struct device_driver {
    ......
    bool suppress_bind_attrs; /* disables bind/unbind via sysfs */
    ......
}

如下:

root@android:/storage/sdcard0 # ls /sys/bus/platform/drivers/switch-gpio/                                                   
bind   uevent unbind

在kernel中,bind/unbind是从用户空间手动的为driver绑定/解绑定指定的设备的机制。这种机制是在bus.c中完成的。

 

 

参考:

Linux设备模型(5)_device和device driver: http://www.wowotech.net/linux_kenrel/device_and_driver.html

 

posted on 2020-03-22 22:37  Hello-World3  阅读(1017)  评论(0)    收藏  举报

导航