• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ devfs_unregister函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中devfs_unregister函数的典型用法代码示例。如果您正苦于以下问题:C++ devfs_unregister函数的具体用法?C++ devfs_unregister怎么用?C++ devfs_unregister使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了devfs_unregister函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: scull_cleanup_module

/*
 * The cleanup function is used to handle initialization failures as well.
 * Thefore, it must be careful to work correctly even if some of the items
 * have not been initialized
 */
void scull_cleanup_module(void)
{
    int i;

#ifndef CONFIG_DEVFS_FS
    /* cleanup_module is never called if registering failed */
    unregister_chrdev(scull_major, "scull");
#endif

    scull_remove_proc();
    if (scull_devices) {
        for (i=0; i<scull_nr_devs; i++) {
            scull_trim(scull_devices+i);
            /* the following line is only used for devfs */
            devfs_unregister(scull_devices[i].handle);
        }
        kfree(scull_devices);
    }

    /* and call the cleanup functions for friend devices */
    scull_p_cleanup();
    scull_access_cleanup();

    /* once again, only for devfs */
    devfs_unregister(scull_devfs_dir);

}
开发者ID:dot-Sean,项目名称:linux_drivers,代码行数:32,代码来源:main.c


示例2: scull_access_cleanup

/*
 * This is called by cleanup_module or on failure.
 * It is required to never fail, even if nothing was initialized first
 */
void scull_access_cleanup(void)
{
    struct scull_listitem *lptr, *prev;

    scull_trim(&scull_s_device); /* disallocate it */
    scull_trim(&scull_u_device); /* disallocate it */
    scull_trim(&scull_w_device); /* disallocate it */

    /* all the cloned devices */
    prev=NULL;
    for (lptr = scull_c_head; lptr; lptr = lptr->next) {
        scull_trim(&(lptr->device));
        if (prev) kfree(prev);
        prev=lptr;
    }
    if (prev) kfree(prev);
    scull_c_head = NULL; /* overkill: we're unloading anyways */

    /* remove devfs entry points */
    devfs_unregister(scull_s_device.handle);
    devfs_unregister(scull_u_device.handle);
    devfs_unregister(scull_w_device.handle);
    devfs_unregister(scull_priv_handle);

    return;
}
开发者ID:dot-Sean,项目名称:linux_drivers,代码行数:30,代码来源:access.c


示例3: lvm_fs_remove_vg

void lvm_fs_remove_vg(vg_t *vg_ptr) {
	int i;

	if (!vg_ptr)
		return;

	devfs_unregister(ch_devfs_handle[vg_ptr->vg_number]);
	ch_devfs_handle[vg_ptr->vg_number] = NULL;

	/* remove lv's */
	for(i = 0; i < vg_ptr->lv_max; i++)
		if(vg_ptr->lv[i]) lvm_fs_remove_lv(vg_ptr, vg_ptr->lv[i]);

	/* must not remove directory before leaf nodes */
	devfs_unregister(vg_devfs_handle[vg_ptr->vg_number]);
	vg_devfs_handle[vg_ptr->vg_number] = NULL;

	/* remove pv's */
	for(i = 0; i < vg_ptr->pv_max; i++)
		if(vg_ptr->pv[i]) lvm_fs_remove_pv(vg_ptr, vg_ptr->pv[i]);

	if(vg_ptr->vg_dir_pde) {
		remove_proc_entry(LVM_LV_SUBDIR, vg_ptr->vg_dir_pde);
		vg_ptr->lv_subdir_pde = NULL;

		remove_proc_entry(LVM_PV_SUBDIR, vg_ptr->vg_dir_pde);
		vg_ptr->pv_subdir_pde = NULL;

		remove_proc_entry("group", vg_ptr->vg_dir_pde);
		vg_ptr->vg_dir_pde = NULL;

		remove_proc_entry(vg_ptr->vg_name, lvm_proc_vg_subdir);
	}
}
开发者ID:jameshilliard,项目名称:actiontec_opensource_mi424wr-rev-acd-56-0-10-14-4,代码行数:34,代码来源:lvm-fs.c


示例4: mtd_notify_remove

static void mtd_notify_remove(struct mtd_info* mtd)
{
	if (!mtd)
		return;

	devfs_unregister(devfs_rw_handle[mtd->index]);
	devfs_unregister(devfs_ro_handle[mtd->index]);
}
开发者ID:jameshilliard,项目名称:actiontec_opensource_mi424wr-rev-acd-56-0-10-14-4,代码行数:8,代码来源:mtdchar.c


示例5: gpio_exit

static void __exit
gpio_exit(void)
{
int i;
	for (i = 0; i < ARRAYSIZE(gpio_file); i++)
		devfs_unregister(gpio_file[i].handle);
	devfs_unregister(gpio_dir);
	devfs_unregister_chrdev(gpio_major, "gpio");
	sb_detach(gpio_sbh);}
开发者ID:cilynx,项目名称:dd-wrt,代码行数:9,代码来源:linux_gpio.c


示例6: fpga_exit

void __exit fpga_exit(void)
{

#ifdef CONFIG_DEVFS_FS	
	devfs_unregister(devfs_fpgaraw);
	devfs_unregister(devfs_fpga_dir);
#endif
	unregister_chrdev(fpgaMajor, DEVICE_NAME);
}
开发者ID:AxelLin,项目名称:Drv,代码行数:9,代码来源:s3c2410-fpga.c


示例7: s3c2410_adc_exit

void __exit s3c2410_adc_exit(void)
{
#ifdef CONFIG_DEVFS_FS	
	devfs_unregister(devfs_adcraw);
	devfs_unregister(devfs_adc_dir);
#endif
	unregister_chrdev(adcMajor, DEVICE_NAME);

	free_irq(IRQ_ADC_DONE, NULL);
}
开发者ID:AxelLin,项目名称:Drv,代码行数:10,代码来源:s3c2410-adc.c


示例8: s3c2410_kbd_exit

static void __exit s3c2410_kbd_exit(void)
{

#ifdef CONFIG_DEVFS_FS	
	devfs_unregister(devfs_kbdraw);
	devfs_unregister(devfs_kbd_dir);
#endif
	unregister_chrdev(kbdMajor, DEVICE_NAME);

	free_irq(IRQ_KBD, s3c2410_isr_kbd);
}
开发者ID:AxelLin,项目名称:Drv,代码行数:11,代码来源:s3c2410-kbd-zlg7290.c


示例9: s3c2410_ts_exit

static void __exit s3c2410_ts_exit(void)
{
#ifdef CONFIG_DEVFS_FS	
	devfs_unregister(devfs_tsraw);
	devfs_unregister(devfs_ts_dir);
#endif	
	unregister_chrdev(tsMajor, DEVICE_NAME);
#ifdef CONFIG_PM
	pm_unregister(tsdev.pm_dev);
#endif
	free_irq(IRQ_ADC_DONE, s3c2410_isr_adc);
	free_irq(IRQ_TC, s3c2410_isr_tc);
}
开发者ID:chenzhongtao,项目名称:source,代码行数:13,代码来源:s3c2410-ts.c


示例10: devfs_unregister_card

static void devfs_unregister_card(struct em84xx *card)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69)
    devfs_unregister(em8300_handle[0]);
    devfs_unregister(em8300_handle[1]);
    devfs_unregister(em8300_handle[2]);
    devfs_unregister(em8300_handle[3]);
#else
    devfs_remove("%s%d", REALMAGIC_DEVICE_NAME, 0);
    devfs_remove("%s%d", REALMAGIC_DEVICE_NAME, 1);
    devfs_remove("%s%d", REALMAGIC_DEVICE_NAME, 2);
    devfs_remove("%s%d", REALMAGIC_DEVICE_NAME, 3);
#endif
}
开发者ID:aaron619,项目名称:Em8401LinuxDriver,代码行数:14,代码来源:devfs.c


示例11: camera_disconnect

static void camera_disconnect(struct usb_device *dev, void *ptr)
{
	struct camera_state	*camera = (struct camera_state *) ptr;
	int			subminor = camera->subminor;

	down (&state_table_mutex);
	down (&camera->sem);

	devfs_unregister(camera->devfs); 

	/* If camera's not opened, we can clean up right away.
	 * Else apps see a disconnect on next I/O; the release cleans.
	 */
	if (!camera->buf) {
		minor_data [subminor] = NULL;
		kfree (camera);
		camera = NULL;
	} else
		camera->dev = NULL;

	info ("USB Camera #%d disconnected", subminor);
	usb_dec_dev_use (dev);

	if (camera != NULL)
		up (&camera->sem);
	up (&state_table_mutex);
}
开发者ID:fgeraci,项目名称:cs518-sched,代码行数:27,代码来源:dc2xx.c


示例12: disconnect_scanner

static void
disconnect_scanner(struct usb_device *dev, void *ptr)
{
	struct scn_usb_data *scn = (struct scn_usb_data *) ptr;

	down (&scn_mutex);
	down (&(scn->sem));

	if(scn->intr_ep) {
		dbg("disconnect_scanner(%d): Unlinking IRQ URB", scn->scn_minor);
		usb_unlink_urb(&scn->scn_irq);
	}
        usb_driver_release_interface(&scanner_driver,
                &scn->scn_dev->actconfig->interface[scn->ifnum]);

	kfree(scn->ibuf);
	kfree(scn->obuf);

	dbg("disconnect_scanner: De-allocating minor:%d", scn->scn_minor);
	devfs_unregister(scn->devfs);
	p_scn_table[scn->scn_minor] = NULL;
	up (&(scn->sem));
	kfree (scn);
	up (&scn_mutex);
}
开发者ID:nhanh0,项目名称:hah,代码行数:25,代码来源:scanner.c


示例13: ipmi_smi_gone

static void ipmi_smi_gone(int if_num)
{
	if (if_num > MAX_DEVICES)
		return;

	devfs_unregister(handles[if_num]);
}
开发者ID:GunioRobot,项目名称:MI424WR_GEN2_Rev_E-F,代码行数:7,代码来源:ipmi_devintf.c


示例14: skel_disconnect

/**
 *	skel_disconnect
 *
 *	Called by the usb core when the device is removed from the system.
 */
static void skel_disconnect(struct usb_device *udev, void *ptr)
{
	struct usb_skel *dev;
	int minor;

	dev = (struct usb_skel *)ptr;
	
	down (&minor_table_mutex);
	down (&dev->sem);
		
	minor = dev->minor;

	/* remove our devfs node */
	devfs_unregister(dev->devfs);

	/* if the device is not opened, then we clean up right now */
	if (!dev->open_count) {
		up (&dev->sem);
		skel_delete (dev);
	} else {
		dev->udev = NULL;
		up (&dev->sem);
	}

	info("USB Skeleton #%d now disconnected", minor);
	up (&minor_table_mutex);
}
开发者ID:gatieme,项目名称:LDD-LinuxDeviceDrivers,代码行数:32,代码来源:usb-skeleton+.c


示例15: init_module

int __init
init_module(void)
{  
    int rc;

    /* Get our definition */
    _gmodule = gmodule_get();
    if(!_gmodule) return -ENODEV;


    /* Register ourselves */
#ifdef GMODULE_CONFIG_DEVFS_FS
    devfs_handle = devfs_register(NULL, 
				  _gmodule->name, 
				  DEVFS_FL_NONE, 
				  _gmodule->major,
				  _gmodule->minor, 
				  S_IFCHR | S_IRUGO | S_IWUGO,
				  &_gmodule_fops, 
				  NULL);
    if(!devfs_handle) {
	printk(KERN_WARNING "%s: can't register device with devfs", 
	       _gmodule->name);
    }
    rc = 0;
#else
    rc = register_chrdev(_gmodule->major, 
			 _gmodule->name, 
			 &_gmodule_fops);
    if (rc < 0) {
	printk(KERN_WARNING "%s: can't get major %d",
	       _gmodule->name, _gmodule->major);
	return rc;
    }

    if(_gmodule->major == 0) {
	_gmodule->major = rc;
    }
#endif

    /* Specific module Initialization */
    if(_gmodule->init) {
	int rc;
	if((rc = _gmodule->init()) < 0) {
#ifdef GMODULE_CONFIG_DEVFS_FS
            if(devfs_handle) devfs_unregister(devfs_handle);
#else
            unregister_chrdev(_gmodule->major, _gmodule->name);
#endif
	    return rc;
	}
    }

    /* Add a /proc entry, if valid */
    if(_gmodule->pprint) {    
	_gmodule_create_proc();
    }

    return 0; /* succeed */
}
开发者ID:Azure,项目名称:sonic-buildimage,代码行数:60,代码来源:gmodule.c


示例16: ndas_ctrldev_cleanup

int ndas_ctrldev_cleanup(void)
{
#if LINUX_VERSION_25_ABOVE 
#if LINUX_VERSION_HAS_CLASS_CREATE 

#if LINUX_VERSION_HAS_DEVICE_CREATE
    device_destroy(ndas_ctrldev_class, MKDEV(NDAS_CHR_DEV_MAJOR, NDAS_CHR_DEV_MINOR));
#else
    class_device_destroy(ndas_ctrldev_class, MKDEV(NDAS_CHR_DEV_MAJOR, NDAS_CHR_DEV_MINOR));
#endif //#if LINUX_VERSION_HAS_DEVICE_CREATE

    class_destroy(ndas_ctrldev_class);
#else
    class_simple_device_remove(MKDEV(NDAS_CHR_DEV_MAJOR, NDAS_CHR_DEV_MINOR));
    class_simple_destroy(ndas_ctrldev_class);
#endif  /* LINUX_VERSION_HAS_CLASS_CREATE */
#endif /* LINUX_VERSION_25_ABOVE  */

#ifdef NDAS_DEVFS
		devfs_unregister(devfs_control_handle);
#else
		unregister_chrdev(NDAS_CHR_DEV_MAJOR, "ndas");
#endif

    return 0;
}
开发者ID:dansdrivers,项目名称:ndas4linux,代码行数:26,代码来源:ctrldev.c


示例17: duslic_module_exit

/****************************************************************************
Description:
   Clean up the module if unloaded.
Arguments:
   None.
Return Value:
   None.
Remarks:
   Called by the kernel.
****************************************************************************/
static void __exit duslic_module_exit(void)
{
    IFX_int32_t i;
#ifdef CONFIG_DEVFS_FS
    IFX_int32_t j;
#endif /* CONFIG_DEVFS_FS */

   for (i=0; i < DUSLIC_MAX_DEVICES; i++)
   {
#ifdef CONFIG_DEVFS_FS
      /* remove duslic devices from dev fs */
      for (j = 0; j <= DUSLIC_MAX_CHANNELS; j++ )
      {
         if (devfs_handle[i*DUSLIC_MAX_CHANNELS + j])
         {
	    //printk("unregister dus%d%d\n",i+1,j);
            devfs_unregister (devfs_handle[i*DUSLIC_MAX_CHANNELS + j]);
         }
      }
#else 
    unregister_chrdev (DUSLIC_MAJOR, DEV_NAME);
#endif /* CONFIG_DEVFS_FS */
   }
   
   for (i=0; i < DUSLIC_MAX_DEVICES; i++)
   {
      if (pDuslic_Devices[i] != NULL)
      {
         ReleaseDevice (pDuslic_Devices[i]);
      }
   }
   remove_proc_entry(DEV_NAME,NULL);
}
开发者ID:pekiZG,项目名称:sx76x-openwrt-danube,代码行数:43,代码来源:drv_duslic_linux.c


示例18: h3600_stowaway_cleanup_module

void __exit h3600_stowaway_cleanup_module( void )
{
	unregister_sysctl_table(h3600_stowaway_sysctl_header);
	remove_proc_entry(H3600_STOWAWAY_PROC_STATS, proc_dir);

	devfs_unregister( devfs_stowaway );
	devfs_unregister_chrdev( g_stowaway_major, H3600_STOWAWAY_MODULE_NAME );
}
开发者ID:zipangotes,项目名称:DSL-G624T_GPL_code,代码行数:8,代码来源:h3600_stowaway.c


示例19: lvm_fin_fs

void lvm_fin_fs() {
#if 0
	devfs_unregister (lvm_devfs_handle);
#endif
	remove_proc_entry(LVM_GLOBAL, lvm_proc_dir);
	remove_proc_entry(LVM_VG_SUBDIR, lvm_proc_dir);
	remove_proc_entry(LVM_DIR, &proc_root);
}
开发者ID:jameshilliard,项目名称:actiontec_opensource_mi424wr-rev-acd-56-0-10-14-4,代码行数:8,代码来源:lvm-fs.c


示例20: gfx_inf_deinit

static void __exit gfx_inf_deinit(void)
{
    devfs_unregister_chrdev(GFX_DEV_MAJOR, GFX_DRIVER_NAME);
    if(devfs_handle != NULL)
      devfs_unregister(devfs_handle);
    gfx_inf_h_deinit(2);
    gfx_atom_deinit();  // BJC 102102
}
开发者ID:thefkboss,项目名称:dm500-satip,代码行数:8,代码来源:gfx_inf.c



注:本文中的devfs_unregister函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ devfsadm_mklink函数代码示例发布时间:2022-05-30
下一篇:
C++ devfs_remove函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap