作者pilipalabon (说好的性福呢?)
看板LinuxDev
标题[问题] struct file *filp, struct inode *inode
时间Thu Aug 18 10:52:43 2011
目前写 touchscreen的driver, 除了标准的input interface外,
还要再新增一个更新fw的功能, 就是misc_register()
因此会要建立file_operation的pointer, 主要问题是在
open(struct inode *inode, struct file *filp)
上面那两个struct内的值, 因为我的driver架构是上面有一个大的
struct xxx_ts *ts; 来管理我全部的变数, 之前在别的function呼叫时,
因为有先把他设入
i2c_set_clientdata(client, ts);
input_set_drvdata(ts->input, ts);
因此可以顺利得到 ts 的结构, 顺利操控ts内的值.
但是现在问题来了, 我无法在open()内不透过 Global variable方式
去得到 ts, 我有看过kernel内其他driver的作法, 但还是无法
配合到我的driver上, 因此想请教各位, 这种情况要取道ts,
都是怎样取得的, 谢谢.
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 192.72.220.129