LDD3 linux设备驱动程序学习之lddbus
来源:互联网 发布:java aes 32位key 编辑:程序博客网 时间:2024/06/05 10:05
1. struct device不再包含bus_id,取而代之的是.init_name,修改ldd_bus
- struct device ldd_bus = {
- .init_name = "ldd0",
- .release = ldd_bus_release
将strncpy(ldddev->dev.bus_id, ldddev->name, BUS_ID_SIZE);
替换为:
ldddev->dev.init_name = ldddev->name;
修改函数ldd_match如下:
return !(strncmp(dev->bus_id, driver->name, strlen(driver->name));
修改为
return !strncmp(dev->init_name, driver->name, strlen(driver->name));
2. 结构体struct bus_type已经改变,不再包含hotplug,取而代之的是uevent,故修改
结构体ldd_bus_type如下:
- struct bus_type ldd_bus_type = {
- .name = "ldd",
- .match = ldd_match,
- .uevent = ldd_uevent,
- };
- static int ldd_uevent(struct device *dev, struct kobj_uevent_env *env) {
- env->envp[0] = evn->buf;
- if (snprintf(env->buf, env->buflen, "LDDBUS_VERSION=%s", Version) >= env->buflen)
- return -ENOMEM;
- env->envp[1] = NULL;
- return 0;
- }
阅读全文
0 0
- LDD3 linux设备驱动程序学习之lddbus
- LDD3 linux设备驱动程序学习之lddbus
- LDD3 linux设备驱动程序学习之lddbus
- LDD3源码分析之字符设备驱动程序
- LDD3源码分析之字符设备驱动程序
- LDD3源码分析之字符设备驱动程序
- LDD3源码分析之块设备驱动程序
- LDD3源码分析之字符设备驱动程序
- LDD3源码分析之字符设备驱动程序
- LDD3源码分析之字符设备驱动程序
- lddbus-sculld之设备模型
- LDD3学习笔记Linux设备模型之由来
- Linux设备驱动程序(ldd3)代码中的问题
- Linux设备驱动程序(LDD3)中snull的编译问题
- Linux设备驱动程序(LDD3)中snull的编译问题
- Linux设备驱动程序学习之基础篇
- Linux设备驱动程序学习之分配内存
- LDD3源码分析之字符设备驱动程序(加上测试代码)
- iOS开发中,各个UI控件之间的继承关系
- FlashBuilder精选插件
- 欢迎使用CSDN-markdown编辑器
- MySQL存储过程详解(终极版)
- request对象
- LDD3 linux设备驱动程序学习之lddbus
- 矩形面积并、矩形面积交、矩形周长并(线段树、扫描线总结)
- Widget 桌面小控件
- SQL truncate 、delete和drop的异同
- [LeetCode] Palindrome Pairs
- MyBatis动态查询(where trim set)
- HTML DOM之属性的各种操作方法
- 【MongoDB】mongo时间问题
- JavaScript 跨域访问的问题和解决过程