博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux Kernel input设备之handle注册
阅读量:4152 次
发布时间:2019-05-25

本文共 1183 字,大约阅读时间需要 3 分钟。

/** * input_register_handle - register a new input handle * @handle: handle to register * * This function puts a new input handle onto device's * and handler's lists so that events can flow through * it once it is opened using input_open_device(). * * This function is supposed to be called from handler's * connect() method. */int input_register_handle(struct input_handle *handle){	struct input_handler *handler = handle->handler;	struct input_dev *dev = handle->dev;	int error;	/*	 * We take dev->mutex here to prevent race with	 * input_release_device().	 */	error = mutex_lock_interruptible(&dev->mutex);	if (error)		return error;	/*	 * Filters go to the head of the list, normal handlers	 * to the tail.	 */	if (handler->filter)		list_add_rcu(&handle->d_node, &dev->h_list);	else		list_add_tail_rcu(&handle->d_node, &dev->h_list);	mutex_unlock(&dev->mutex);	/*	 * Since we are supposed to be called from ->connect()	 * which is mutually exclusive with ->disconnect()	 * we can't be racing with input_unregister_handle()	 * and so separate lock is not needed here.	 */	list_add_tail_rcu(&handle->h_node, &handler->h_list);	if (handler->start)		handler->start(handle);	return 0;}
 
 

转载地址:http://awhti.baihongyu.com/

你可能感兴趣的文章
内核线程创建
查看>>
linux elf tool readelf
查看>>
linux tool objdump
查看>>
linux tool nm
查看>>
字节对齐
查看>>
Python-发邮件
查看>>
python写入csv文件的两种方法
查看>>
pandas学习笔记—dataframe与list相互转化
查看>>
Keras和TensorFlow设置GPU及其使用率
查看>>
python常见异常处理方法
查看>>
pandas学习笔记—merge()函数详解
查看>>
pandas学习笔记—agg()函数详解
查看>>
Canny边缘检测算法原理及其OpenCV实现
查看>>
JupyterLab on JupyterHub(JupyterLab+JupyterHub)(JupyterLab JupyterHub)
查看>>
Ubuntu查找文件或文件夹
查看>>
DIGITS安装及服务部署
查看>>
利用Python脚本开发Hadoop的MapReduce大数据分析应用
查看>>
python连接SQL数据库
查看>>
python创建mysql数据库中的表
查看>>
python操作mysql表格-插入数据
查看>>