close.c

来自「PCM9880是一块PC/104界面的双端口隔离CAN总线通讯卡」· C语言 代码 · 共 46 行

C
46
字号
/* close.c * Linux CAN-bus device driver. * Written by Arnaud Westenberg email:arnaud@wanadoo.nl * This software is released under the GPL-License. * Version 0.7  6 Aug 2001 */#define __NO_VERSION__#include <linux/module.h> #include <linux/autoconf.h>#if defined (CONFIG_MODVERSIONS) && !defined (MODVERSIONS)#define MODVERSIONS#endif#if defined (MODVERSIONS)#include <linux/modversions.h>#endif#include <linux/fs.h>#include "../include/main.h"#include "../include/close.h"#include "../include/i82527.h"#include "../include/setup.h"int can_close(struct inode *inode, struct file *file){	/* Give up message buffer memory */	if (objects_p[MINOR_NR]->fifo->buf_tx_entry)		del_mem_from_list(objects_p[MINOR_NR]->fifo->buf_tx_entry);	else		CANMSG("objects_p[MINOR_NR]->fifo->buf_tx_entry is NULL\n");	if (objects_p[MINOR_NR]->fifo->buf_rx_entry)		del_mem_from_list(objects_p[MINOR_NR]->fifo->buf_rx_entry);	else		CANMSG("objects_p[MINOR_NR]->fifo->buf_rx_entry is NULL\n");/* FIXME: what about clearing chip HW status, stopping sending messages etc? */		objects_p[MINOR_NR]->flags &= ~OPENED;	MOD_DEC_USE_COUNT;	return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?