当前位置: 技术问答>linux和unix
如何关闭应用程序中打开的内核设备?
来源: 互联网 发布时间:2016-07-30
本文导语: 我是2.4内核,移植到开发板上,驱动形式如下: ———————————————————————————————— static struct file_operations spi_drv_fops = { ioctl: spi_drv_ioctl, open: spi_drv_ope...
我是2.4内核,移植到开发板上,驱动形式如下:
————————————————————————————————
static struct file_operations spi_drv_fops =
{
ioctl: spi_drv_ioctl,
open: spi_drv_open,
release: spi_drv_release,
read: spi_drv_read,
};
static void __exit spi_drv_cleanup(void)
{
int ret;
ret = unregister_chrdev(major, NAME);
if (ret
————————————————————————————————
static struct file_operations spi_drv_fops =
{
ioctl: spi_drv_ioctl,
open: spi_drv_open,
release: spi_drv_release,
read: spi_drv_read,
};
static void __exit spi_drv_cleanup(void)
{
int ret;
ret = unregister_chrdev(major, NAME);
if (ret