【发布时间】:2013-07-19 06:19:05
【问题描述】:
我有两个平台设备/驱动程序 - 比如说 Pdriver1 和 Pdriver2。 我想从 Pdriver2 访问 Pdriver1 的平台特定数据。 我怎样才能做到这一点?
【问题讨论】:
-
装有这些驱动程序的计算机如何连接?
-
我已经使用 platform_device_registered 和 platform_driver_registered API 注册了两个驱动程序
-
两个驱动程序是在同一台计算机上运行还是在不同的计算机上运行?
-
是的,两个驱动程序都在同一台计算机上运行。我已经声明了一个全局结构 struct test { int a; };现在在 pdriver1 的 Probe 函数中,我正在初始化全局结构,例如静态 int test_probe(struct platform_device *pdev) { struct test *temp = kmalloc(sizeof(struct test),GFP_KERNEL); if(temp == NULL) { 返回 -1; } 温度->a =10;现在我想在 pdriver2 中访问这个结构值
标签: linux-kernel linux-device-driver