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

C++ devfs_remove函数代码示例

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

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



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

示例1: mtd_notify_remove

static void mtd_notify_remove(struct mtd_info* mtd)
{
	if (!mtd)
		return;
	devfs_remove("mtd/%d", mtd->index);
	devfs_remove("mtd/%dro", mtd->index);
}
开发者ID:berte,项目名称:mediaplayer,代码行数:7,代码来源:mtdchar.c


示例2: adc_exit

static void __exit adc_exit(void)
{
#ifdef CONFIG_DEVFS_FS 
 devfs_remove("adc/%d", 0); 
 devfs_remove("adc");   
#endif 
iounmap(peter_base_addr);
 unregister_chrdev(adc_major,DEVICE_NAME); 
 
printk("i am adc_exit, you see me, which means the module is rmmoved\n"); 
}
开发者ID:happypeter,项目名称:tinylion,代码行数:11,代码来源:ad.c


示例3: raw_exit

static void __exit raw_exit(void)
{
	int i;

	for (i = 1; i < MAX_RAW_MINORS; i++)
		devfs_remove("raw/raw%d", i);
	devfs_remove("raw/rawctl");
	devfs_remove("raw");
	cdev_del(&raw_cdev);
	unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS);
}
开发者ID:iPodLinux,项目名称:linux-2.6.7-ipod,代码行数:11,代码来源:raw.c


示例4: cleanup_module

void cleanup_module(void)
{
	/*
	 * Unregister the device
	 */
	devfs_remove("dvb/adapter0/frontend0");
	class_simple_device_remove(MKDEV(DVB_MAJOR, 3));
	devfs_remove("dvb");
	class_simple_destroy(my_class);
	cdev_del(&device_cdev);
	unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), 64);
	printk(KERN_INFO "[td-dvb-fe] unload successful\n");
}
开发者ID:seife,项目名称:td-dvb-wrapper,代码行数:13,代码来源:td-dvb-frontend.c


示例5: ddi_remove_minor_node

void
ddi_remove_minor_node(dev_info_t *dip, char *name)
{
    //printf("zvol: remove minor: '%s'\n", name ? name : "");
    if (dip->devc) {
        devfs_remove(dip->devc);
        dip->devc = NULL;
    }
    if (dip->devb) {
        devfs_remove(dip->devb);
        dip->devb = NULL;
    }
}
开发者ID:rottegift,项目名称:spl,代码行数:13,代码来源:spl-ddi.c


示例6: mtd_notify_remove

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

#ifdef CONFIG_DEVFS_FS
	devfs_remove("mtd/%d", mtd->index);
	devfs_remove("mtd/%dro", mtd->index);
#else
	class_device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2));
	class_device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1));
#endif
}
开发者ID:cilynx,项目名称:dd-wrt,代码行数:13,代码来源:mtdchar.c


示例7: devfs_remove_disk

void devfs_remove_disk(struct gendisk *disk)
{
	if (disk->minors != 1) {
		devfs_remove("discs/disc%d", disk->number);
		dealloc_unique_number(&disc_numspace, disk->number);
		devfs_remove("%s/disc", disk->devfs_name);
	}
	if (disk->flags & GENHD_FL_CD) {
		devfs_remove("cdroms/cdrom%d", disk->number);
		dealloc_unique_number(&cdrom_numspace, disk->number);
	}
	devfs_remove(disk->devfs_name);
}
开发者ID:FelipeFernandes1988,项目名称:Alice-1121-Modem,代码行数:13,代码来源:devfs.c


示例8: 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


示例9: bpp_cleanup

static void __exit bpp_cleanup(void)
{
	unsigned idx;

	for (idx = 0; idx < BPP_NO; idx++)
		devfs_remove("bpp/%d", idx);
	devfs_remove("bpp");
	unregister_chrdev(BPP_MAJOR, dev_name);

	for (idx = 0;  idx < BPP_NO; idx++) {
		if (instances[idx].present)
			freeLptPort(idx);
	}
}
开发者ID:kzlin129,项目名称:tt-gpl,代码行数:14,代码来源:bpp.c


示例10: ubi_free_volume

/**
 * ubi_free_volume - free volume.
 * @ubi: UBI device description object
 * @vol: volume description object
 *
 * This function frees all resources for volume @vol but does not remove it.
 * Used only when the UBI device is detached.
 */
void ubi_free_volume(struct ubi_device *ubi, struct ubi_volume *vol)
{
	dbg_gen("free volume %d", vol->vol_id);

	ubi->volumes[vol->vol_id] = NULL;
	devfs_remove(&vol->cdev);
}
开发者ID:AshishNamdev,项目名称:barebox,代码行数:15,代码来源:vmt.c


示例11: lpp_remove_one

static void lpp_remove_one (struct pci_dev *pdev)
    {
	DEV *dev = pci_get_drvdata(pdev);
    dbg("%s(): dev=%08X pci_dev->vendor=%04X device=%04X",
        __FUNCTION__, (uint)dev, 
        pdev->vendor, pdev->device);
	if (!dev)  BUG();

    down (&minor_table_mutex);
#ifdef CONFIG_DEVFS_FS
	devfs_remove("lpc/%d", dev->minor);
#endif
    minor_table[dev->minor] = NULL;
//	unregister_netdev(dev);
//	iounmap(cp->regs);
	pci_release_regions(pdev);
	pci_clear_mwi(pdev);
	pci_disable_device(pdev);
	pci_set_drvdata(pdev, NULL);
    tasklet_kill(&dev->Dpc);
    kfree(dev);

    info(DRIVER_DESC " " DRIVER_DEV_NAME "%d now disconnected", dev->minor);
    up (&minor_table_mutex);
    }
开发者ID:NhaTrang,项目名称:lon4linux,代码行数:25,代码来源:driverentry.c


示例12: uif_init

/**
 * uif_init - initialize user interfaces for an UBI device.
 * @ubi: UBI device description object
 * @ref: set to %1 on exit in case of failure if a reference to @ubi->dev was
 *       taken, otherwise set to %0
 *
 * This function initializes various user interfaces for an UBI device. If the
 * initialization fails at an early stage, this function frees all the
 * resources it allocated, returns an error, and @ref is set to %0. However,
 * if the initialization fails after the UBI device was registered in the
 * driver core subsystem, this function takes a reference to @ubi->dev, because
 * otherwise the release function ('dev_release()') would free whole @ubi
 * object. The @ref argument is set to %1 in this case. The caller has to put
 * this reference.
 *
 * This function returns zero in case of success and a negative error code in
 * case of failure.
 */
static int uif_init(struct ubi_device *ubi, int *ref)
{
	int i, err;

	*ref = 0;
	sprintf(ubi->ubi_name, UBI_NAME_STR "%d", ubi->ubi_num);

	err = ubi_cdev_add(ubi);
	if (err) {
		ubi_err("cannot add character device");
		goto out_unreg;
	}

	for (i = 0; i < ubi->vtbl_slots; i++)
		if (ubi->volumes[i]) {
			err = ubi_add_volume(ubi, ubi->volumes[i]);
			if (err) {
				ubi_err("cannot add volume %d", i);
				goto out_volumes;
			}
		}

	return 0;

out_volumes:
	kill_volumes(ubi);
	devfs_remove(&ubi->cdev);
out_unreg:
	ubi_err("cannot initialize UBI %s, error %d", ubi->ubi_name, err);
	return err;
}
开发者ID:AshishNamdev,项目名称:barebox,代码行数:49,代码来源:build.c


示例13: miiphy_remove

static void miiphy_remove(struct device_d *dev)
{
	struct miiphy_device *mdev = dev->priv;

	free(mdev->cdev.name);
	devfs_remove(&mdev->cdev);
}
开发者ID:cwyy,项目名称:barebox,代码行数:7,代码来源:miiphy.c


示例14: dsp56k_cleanup_driver

static void __exit dsp56k_cleanup_driver(void)
{
	class_simple_device_remove(MKDEV(DSP56K_MAJOR, 0));
	class_simple_destroy(dsp56k_class);
	unregister_chrdev(DSP56K_MAJOR, "dsp56k");
	devfs_remove("dsp56k");
}
开发者ID:iPodLinux,项目名称:linux-2.6.7-ipod,代码行数:7,代码来源:dsp56k.c


示例15: usb_deregister_dev

/**
 * usb_deregister_dev - deregister a USB device's dynamic minor.
 * @intf: pointer to the usb_interface that is being deregistered
 * @class_driver: pointer to the usb_class_driver for this device
 *
 * Used in conjunction with usb_register_dev().  This function is called
 * when the USB driver is finished with the minor numbers gotten from a
 * call to usb_register_dev() (usually when the device is disconnected
 * from the system.)
 *
 * This function also cleans up the devfs file for the usb device, if devfs
 * is enabled, and removes the usb class device from the sysfs tree.
 * 
 * This should be called by all drivers that use the USB major number.
 */
void usb_deregister_dev(struct usb_interface *intf,
			struct usb_class_driver *class_driver)
{
	int minor_base = class_driver->minor_base;
	char name[BUS_ID_SIZE];

#ifdef CONFIG_USB_DYNAMIC_MINORS
	minor_base = 0;
#endif

	if (intf->minor == -1)
		return;

	dbg ("removing %d minor", intf->minor);

	spin_lock (&minor_lock);
	usb_minors[intf->minor] = NULL;
	spin_unlock (&minor_lock);

	snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base);
	devfs_remove (name);
	class_device_destroy(usb_class, MKDEV(USB_MAJOR, intf->minor));
	intf->class_dev = NULL;
	intf->minor = -1;
}
开发者ID:kzlin129,项目名称:tt-gpl,代码行数:40,代码来源:file.c


示例16: OsqueryStop

kern_return_t OsqueryStop(kmod_info_t *ki, void *d) {
    dbg_printf("Kernel module stoping!\n");

    lck_mtx_lock(osquery.mtx);
    if (osquery.open_count > 0) {
        lck_mtx_unlock(osquery.mtx);
        return KERN_FAILURE;
    }

    if (osquery_cqueue_teardown(&osquery.cqueue)) {
        lck_mtx_unlock(osquery.mtx);
        return KERN_FAILURE;
    }

    devfs_remove(osquery.devfs);
    osquery.devfs = NULL;

    if (cdevsw_remove(osquery.major_number, &osquery_cdevsw) < 0) {
        panic("osquery kext: Cannot remove osquery from cdevsw");
    }

    lck_mtx_unlock(osquery.mtx);
    teardown_locks();

    return KERN_SUCCESS;
}
开发者ID:nitish3328,项目名称:osquery,代码行数:26,代码来源:osquery.cpp


示例17: OsqueryStop

kern_return_t OsqueryStop(kmod_info_t *ki, void *d) {
  dbg_printf("Kernel module stopping!\n");

  // Only stop if there are no connected daemons.
  lck_mtx_lock(osquery.mtx);
  if (osquery.open_count > 0) {
    lck_mtx_unlock(osquery.mtx);
    return KERN_FAILURE;
  }

  // Stop sharing the queue and remove queue locks.
  // This will potentially block as heuristics are applied to make sure the
  // queue is no longer is use.
  if (osquery_cqueue_teardown(&osquery.cqueue)) {
    lck_mtx_unlock(osquery.mtx);
    return KERN_FAILURE;
  }

  // Remove the device node.
  devfs_remove(osquery.devfs);
  osquery.devfs = NULL;

  // Tear down the device node data.
  if (cdevsw_remove(osquery.major_number, &osquery_cdevsw) < 0) {
    panic("osquery kext: Cannot remove osquery from cdevsw");
  }

  // Deallocate the IOCTL and kernel API locks.
  lck_mtx_unlock(osquery.mtx);
  teardown_locks();

  return KERN_SUCCESS;
}
开发者ID:1514louluo,项目名称:osquery,代码行数:33,代码来源:osquery.cpp


示例18: vnclear

void
vnclear(struct vn_softc *vn, vfs_context_t ctx)
{
	if (vn->sc_vp != NULL) {
		/* release long-term reference */
		(void)vn_close(vn->sc_vp, vn->sc_open_flags, ctx);
		vn->sc_vp = NULL;
	}
	if (vn->sc_shadow_vp != NULL) {
		/* release long-term reference */
		(void)vn_close(vn->sc_shadow_vp, FREAD | FWRITE, ctx);
		vn->sc_shadow_vp = NULL;
	}
	if (vn->sc_shadow_map != NULL) {
		shadow_map_free(vn->sc_shadow_map);
		vn->sc_shadow_map = NULL;
	}
	vn->sc_flags &= ~(VNF_INITED | VNF_READONLY);
	if (vn->sc_cred) {
		kauth_cred_unref(&vn->sc_cred);
	}
	vn->sc_size = 0;
	vn->sc_fsize = 0;
	if (vn->sc_cdev) {
		devfs_remove(vn->sc_cdev);
		vn->sc_cdev = NULL;
	}
}
开发者ID:Apple-FOSS-Mirror,项目名称:xnu,代码行数:28,代码来源:vn.c


示例19: pmem_cleanup

// Tries to free all resources and also passes through any errors
//
// args: the error arg will be overwritten with KERN_FAILURE in case of an error
//       or returned unmodified in case everything went well.
// return: the given error argument or KERN_FAILURE if anything went wrong
static int pmem_cleanup(int error) {
  if (pmem_zero_page) {
    OSFree(pmem_zero_page, PAGE_SIZE, pmem_tag);
  }
  if (pte_mmap != NULL) {
    pte_mmap_osx_delete(pte_mmap);
  }
  if (pmem_tag) {
    OSMalloc_Tagfree(pmem_tag);
  }
  if (pmem_devpmemnode) {
    devfs_remove(pmem_devpmemnode);
  }
  if (pmem_devmajor != -1) {
    int devindex = 0;
    devindex = cdevsw_remove(pmem_devmajor, &pmem_cdevsw);
    if (devindex != pmem_devmajor) {
      pmem_error("Failed to remove cdevsw, cdevsw_remove() returned %d,"
                 "should be %d", devindex, pmem_devmajor);
      pmem_error("Kext will not be unloaded as an uio could result"
                 " in calling non-existent code");
      error = KERN_FAILURE;
    }
  }

  return error;
}
开发者ID:KarlVogel,项目名称:rekall,代码行数:32,代码来源:pmem.cpp


示例20: cpqarray_remove_one

static void __devexit cpqarray_remove_one(int i)
{
	int j;
	char buff[4];

	/* sendcmd will turn off interrupt, and send the flush...
	 * To write all data in the battery backed cache to disks
	 * no data returned, but don't want to send NULL to sendcmd */
	if( sendcmd(FLUSH_CACHE, i, buff, 4, 0, 0, 0))
	{
		printk(KERN_WARNING "Unable to flush cache on controller %d\n",
				i);
	}
	free_irq(hba[i]->intr, hba[i]);
	iounmap(hba[i]->vaddr);
	unregister_blkdev(COMPAQ_SMART2_MAJOR+i, hba[i]->devname);
	del_timer(&hba[i]->timer);
	remove_proc_entry(hba[i]->devname, proc_array);
	pci_free_consistent(hba[i]->pci_dev,
			NR_CMDS * sizeof(cmdlist_t), (hba[i]->cmd_pool),
			hba[i]->cmd_pool_dhandle);
	kfree(hba[i]->cmd_pool_bits);
	for(j = 0; j < NWD; j++) {
		if (ida_gendisk[i][j]->flags & GENHD_FL_UP)
			del_gendisk(ida_gendisk[i][j]);
		devfs_remove("ida/c%dd%d",i,j);
		put_disk(ida_gendisk[i][j]);
	}
	blk_cleanup_queue(hba[i]->queue);
	release_io_mem(hba[i]);
	free_hba(i);
}
开发者ID:Dronevery,项目名称:JetsonTK1-kernel,代码行数:32,代码来源:cpqarray.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ devfs_unregister函数代码示例发布时间:2022-05-30
下一篇:
C++ devdirread函数代码示例发布时间: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