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

C++ device_del函数代码示例

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

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



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

示例1: mmc_remove_card

/*
 * Unregister a new MMC card with the driver model, and
 * (eventually) free it.
 */
void mmc_remove_card(struct mmc_card *card)
{
#ifdef CONFIG_DEBUG_FS
	mmc_remove_card_debugfs(card);
#endif

	if (mmc_card_present(card)) {
		if (mmc_host_is_spi(card->host)) {
			pr_info("%s: SPI card removed\n",
				mmc_hostname(card->host));
		} else {
			pr_info("%s: card %04x removed\n",
				mmc_hostname(card->host), card->rca);
		}
		device_del(&card->dev);
	}

	put_device(&card->dev);
}
开发者ID:7799,项目名称:linux,代码行数:23,代码来源:bus.c


示例2: cec_devnode_unregister

/*
 * Unregister a cec device node
 *
 * This unregisters the passed device. Future open calls will be met with
 * errors.
 *
 * This function can safely be called if the device node has never been
 * registered or has already been unregistered.
 */
static void cec_devnode_unregister(struct cec_devnode *devnode)
{
	struct cec_fh *fh;

	/* Check if devnode was never registered or already unregistered */
	if (!devnode->registered || devnode->unregistered)
		return;

	mutex_lock(&devnode->fhs_lock);
	list_for_each_entry(fh, &devnode->fhs, list)
		wake_up_interruptible(&fh->wait);
	mutex_unlock(&devnode->fhs_lock);

	devnode->registered = false;
	devnode->unregistered = true;
	device_del(&devnode->dev);
	cdev_del(&devnode->cdev);
	put_device(&devnode->dev);
}
开发者ID:AK101111,项目名称:linux,代码行数:28,代码来源:cec-core.c


示例3: delete_partition

void delete_partition(struct gendisk *disk, int partno)
{
	struct disk_part_tbl *ptbl = disk->part_tbl;
	struct hd_struct *part;

	if (partno >= ptbl->len)
		return;

	part = ptbl->part[partno];
	if (!part)
		return;

	rcu_assign_pointer(ptbl->part[partno], NULL);
	rcu_assign_pointer(ptbl->last_lookup, NULL);
	kobject_put(part->holder_dir);
	device_del(part_to_dev(part));

	hd_struct_kill(part);
}
开发者ID:J0ngKwanPak,项目名称:linux,代码行数:19,代码来源:partition-generic.c


示例4: usb_disable_device

/*
 * usb_disable_device - Disable all the endpoints for a USB device
 * @dev: the device whose endpoints are being disabled
 * @skip_ep0: 0 to disable endpoint 0, 1 to skip it.
 *
 * Disables all the device's endpoints, potentially including endpoint 0.
 * Deallocates hcd/hardware state for the endpoints (nuking all or most
 * pending urbs) and usbcore state for the interfaces, so that usbcore
 * must usb_set_configuration() before any interfaces could be used.
 */
void usb_disable_device(struct usb_device *dev, int skip_ep0)
{
	int i;

	dev_dbg(&dev->dev, "%s nuking %s URBs\n", __FUNCTION__,
			skip_ep0 ? "non-ep0" : "all");
	for (i = skip_ep0; i < 16; ++i) {
		usb_disable_endpoint(dev, i);
		usb_disable_endpoint(dev, i + USB_DIR_IN);
	}
	dev->toggle[0] = dev->toggle[1] = 0;

	/* getting rid of interfaces will disconnect
	 * any drivers bound to them (a key side effect)
	 */
	if (dev->actconfig) {
		for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
			struct usb_interface	*interface;

			/* remove this interface if it has been registered */
			interface = dev->actconfig->interface[i];
			if (!klist_node_attached(&interface->dev.knode_bus))
				continue;
			dev_dbg (&dev->dev, "unregistering interface %s\n",
				interface->dev.bus_id);
			usb_remove_sysfs_intf_files(interface);
			kfree(interface->cur_altsetting->string);
			interface->cur_altsetting->string = NULL;
			device_del (&interface->dev);
		}

		/* Now that the interfaces are unbound, nobody should
		 * try to access them.
		 */
		for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
			put_device (&dev->actconfig->interface[i]->dev);
			dev->actconfig->interface[i] = NULL;
		}
		dev->actconfig = NULL;
		if (dev->state == USB_STATE_CONFIGURED)
			usb_set_device_state(dev, USB_STATE_ADDRESS);
	}
}
开发者ID:kzlin129,项目名称:tt-gpl,代码行数:53,代码来源:message.c


示例5: platform_device_del

/**
 * platform_device_del - remove a platform-level device
 * @pdev: platform device we're removing
 *
 * Note that this function will also release all memory- and port-based
 * resources owned by the device (@dev->resource).  This function must
 * _only_ be externally called in error cases.  All other usage is a bug.
 */
void platform_device_del(struct platform_device *pdev)
{
	int i;

	if (!IS_ERR_OR_NULL(pdev)) {
		device_del(&pdev->dev);

		if (pdev->id_auto) {
			ida_simple_remove(&platform_devid_ida, pdev->id);
			pdev->id = PLATFORM_DEVID_AUTO;
		}

		for (i = 0; i < pdev->num_resources; i++) {
			struct resource *r = &pdev->resource[i];
			if (r->parent)
				release_resource(r);
		}
	}
}
开发者ID:avagin,项目名称:linux,代码行数:27,代码来源:platform.c


示例6: mmc_remove_card

/*
 * Unregister a new MMC card with the driver model, and
 * (eventually) free it.
 */
void mmc_remove_card(struct mmc_card *card)
{
#ifdef CONFIG_DEBUG_FS
	mmc_remove_card_debugfs(card);
#endif

	if (mmc_card_present(card)) {
		//if(!HOST_IS_EMMC(card->host))
		//	mmc_card_clr_present(card);
		if (mmc_host_is_spi(card->host)) {
			printk(KERN_INFO "%s: SPI card removed\n",
				mmc_hostname(card->host));
		} else {
			printk(KERN_INFO "%s: card %04x removed\n",
				mmc_hostname(card->host), card->rca);
		}
		device_del(&card->dev);
	}

	put_device(&card->dev);
}
开发者ID:avila-devlogic,项目名称:D33_KK_Kernel,代码行数:25,代码来源:bus.c


示例7: edac_remove_sysfs_mci_device

/*
 * remove a Memory Controller instance
 */
void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
{
	int i;

	edac_dbg(0, "\n");

#ifdef CONFIG_EDAC_DEBUG
	debugfs_remove(mci->debugfs);
#endif
#ifdef CONFIG_EDAC_LEGACY_SYSFS
	edac_delete_csrow_objects(mci);
#endif

	for (i = 0; i < mci->tot_dimms; i++) {
		struct dimm_info *dimm = mci->dimms[i];
		if (dimm->nr_pages == 0)
			continue;
		edac_dbg(0, "removing device %s\n", dev_name(&dimm->dev));
		put_device(&dimm->dev);
		device_del(&dimm->dev);
	}
}
开发者ID:ARMWorks,项目名称:FA_2451_Linux_Kernel,代码行数:25,代码来源:edac_mc_sysfs.c


示例8: mmc_remove_card

/*
 * Unregister a new MMC card with the driver model, and
 * (eventually) free it.
 */
void mmc_remove_card(struct mmc_card *card)
{
#ifdef CONFIG_DEBUG_FS
	mmc_remove_card_debugfs(card);
#endif

	if (mmc_card_present(card)) {
#if defined(CONFIG_SDMMC_RK29) && defined(CONFIG_SDMMC_RK29_OLD)
		mmc_card_clr_present(card);
#endif		
		if (mmc_host_is_spi(card->host)) {
			printk(KERN_INFO "%s: SPI card removed\n",
				mmc_hostname(card->host));
		} else {
			printk(KERN_INFO "%s: card %04x removed\n",
				mmc_hostname(card->host), card->rca);
		}
		device_del(&card->dev);
	}

	put_device(&card->dev);
}
开发者ID:AndrewDB,项目名称:rk3066-kernel,代码行数:26,代码来源:bus.c


示例9: mmc_remove_card

/*
 * Unregister a new MMC card with the driver model, and
 * (eventually) free it.
 */
void mmc_remove_card(struct mmc_card *card)
{
#ifdef CONFIG_DEBUG_FS
	mmc_remove_card_debugfs(card);
#endif

	if (mmc_card_present(card)) {
		if (mmc_host_is_spi(card->host)) {
			printk(KERN_INFO "%s: SPI card removed\n",
				mmc_hostname(card->host));
		} else {
			printk(KERN_INFO "%s: card %04x removed\n",
				mmc_hostname(card->host), card->rca);
		}
/*LGE_UPDATE_S DYLEE */
		printk(KERN_INFO "[LGE] mmc device remove\n");	//LGE_UPDATE E720 BCPARK
/*LGE_UPDATE_E DYLEE */
		device_del(&card->dev);
	}

	put_device(&card->dev);
}
开发者ID:markolino631,项目名称:lge_kernel_msm7x27,代码行数:26,代码来源:bus.c


示例10: mmc_remove_card

/*
 * Unregister a new MMC card with the driver model, and
 * (eventually) free it.
 */
void mmc_remove_card(struct mmc_card *card)
{
#ifdef CONFIG_DEBUG_FS
	mmc_remove_card_debugfs(card);
#endif

	if (mmc_card_present(card)) {
		if (mmc_host_is_spi(card->host)) {
			printk(KERN_INFO "%s: SPI card removed\n",
				mmc_hostname(card->host));
		} else {
			printk(KERN_INFO "%s: card %04x removed\n",
				mmc_hostname(card->host), card->rca);
		}
#ifdef CONFIG_MACH_SEMC_ZEUS
		mmc_card_set_removed(card);
#endif /* CONFIG_MACH_SEMC_ZEUS */
		device_del(&card->dev);
	}

	put_device(&card->dev);
}
开发者ID:maxzoel,项目名称:FreeXperia,代码行数:26,代码来源:bus.c


示例11: __iio_trigger_register

int __iio_trigger_register(struct iio_trigger *trig_info,
			   struct module *this_mod)
{
	int ret;

	trig_info->owner = this_mod;

	trig_info->id = ida_simple_get(&iio_trigger_ida, 0, 0, GFP_KERNEL);
	if (trig_info->id < 0)
		return trig_info->id;

	/* Set the name used for the sysfs directory etc */
	dev_set_name(&trig_info->dev, "trigger%ld",
		     (unsigned long) trig_info->id);

	ret = device_add(&trig_info->dev);
	if (ret)
		goto error_unregister_id;

	/* Add to list of available triggers held by the IIO core */
	mutex_lock(&iio_trigger_list_lock);
	if (__iio_trigger_find_by_name(trig_info->name)) {
		pr_err("Duplicate trigger name '%s'\n", trig_info->name);
		ret = -EEXIST;
		goto error_device_del;
	}
	list_add_tail(&trig_info->list, &iio_trigger_list);
	mutex_unlock(&iio_trigger_list_lock);

	return 0;

error_device_del:
	mutex_unlock(&iio_trigger_list_lock);
	device_del(&trig_info->dev);
error_unregister_id:
	ida_simple_remove(&iio_trigger_ida, trig_info->id);
	return ret;
}
开发者ID:avagin,项目名称:linux,代码行数:38,代码来源:industrialio-trigger.c


示例12: scif_peer_add_device

static int scif_peer_add_device(struct scif_dev *scifdev)
{
	struct scif_peer_dev *spdev = rcu_dereference(scifdev->spdev);
	char pool_name[16];
	int ret;

	ret = device_add(&spdev->dev);
	put_device(&spdev->dev);
	if (ret) {
		dev_err(&scifdev->sdev->dev,
			"dnode %d: peer device_add failed\n", scifdev->node);
		goto put_spdev;
	}

	scnprintf(pool_name, sizeof(pool_name), "scif-%d", spdev->dnode);
	scifdev->signal_pool = dmam_pool_create(pool_name, &scifdev->sdev->dev,
						sizeof(struct scif_status), 1,
						0);
	if (!scifdev->signal_pool) {
		dev_err(&scifdev->sdev->dev,
			"dnode %d: dmam_pool_create failed\n", scifdev->node);
		ret = -ENOMEM;
		goto del_spdev;
	}
	dev_dbg(&spdev->dev, "Added peer dnode %d\n", spdev->dnode);
	return 0;
del_spdev:
	device_del(&spdev->dev);
put_spdev:
	RCU_INIT_POINTER(scifdev->spdev, NULL);
	synchronize_rcu();
	put_device(&spdev->dev);

	mutex_lock(&scif_info.conflock);
	scif_info.total--;
	mutex_unlock(&scif_info.conflock);
	return ret;
}
开发者ID:020gzh,项目名称:linux,代码行数:38,代码来源:scif_peer_bus.c


示例13: accfix_remove

static int accfix_remove(struct platform_device *xxx)	
{
	ACCFIX_DEBUG("[accfix]accfix_remove begin!\n");
	if(g_accfix_first == 0)
	{
		free_irq(MT6575_ACCDET_IRQ_ID,NULL);
	}
    
	//cancel_delayed_work(&accfix_work);
	#ifdef ACCFIX_EINT
	destroy_workqueue(accfix_eint_workqueue);
	#endif
	destroy_workqueue(accfix_workqueue);
	switch_dev_unregister(&accfix_data);
	device_del(accfix_nor_device);
	class_destroy(accfix_class);
	cdev_del(accfix_cdev);
	unregister_chrdev_region(accfix_devno,1);	
	input_unregister_device(kpd_accfix_dev);
	ACCFIX_DEBUG("[accfix]accfix_remove Done!\n");
    
	return 0;
}
开发者ID:Demeterp,项目名称:w732_accfix,代码行数:23,代码来源:accfix.c


示例14: svc_update_connection

int svc_update_connection(struct gb_interface *intf,
			  struct gb_connection *connection)
{
	struct gb_bundle *bundle;

	bundle = gb_bundle_create(intf, GB_SVC_BUNDLE_ID, GREYBUS_CLASS_SVC);
	if (!bundle)
		return -EINVAL;

	device_del(&connection->dev);
	connection->bundle = bundle;
	connection->dev.parent = &bundle->dev;
	dev_set_name(&connection->dev, "%s:%d", dev_name(&bundle->dev),
		     GB_SVC_CPORT_ID);

	WARN_ON(device_add(&connection->dev));

	spin_lock_irq(&gb_connections_lock);
	list_add(&connection->bundle_links, &bundle->connections);
	spin_unlock_irq(&gb_connections_lock);

	return 0;
}
开发者ID:bryanodonoghue,项目名称:greybus,代码行数:23,代码来源:connection.c


示例15: edac_delete_csrow_objects

static void edac_delete_csrow_objects(struct mem_ctl_info *mci)
{
	int i, chan;
	struct csrow_info *csrow;

	for (i = mci->nr_csrows - 1; i >= 0; i--) {
		csrow = mci->csrows[i];
		if (!nr_pages_per_csrow(csrow))
			continue;
		for (chan = csrow->nr_channels - 1; chan >= 0; chan--) {
			if (!csrow->channels[chan]->dimm->nr_pages)
				continue;
			edac_dbg(1, "Removing csrow %d channel %d sysfs nodes\n",
				 i, chan);
			device_remove_file(&csrow->dev,
						dynamic_csrow_dimm_attr[chan]);
			device_remove_file(&csrow->dev,
						dynamic_csrow_ce_count_attr[chan]);
		}
		put_device(&mci->csrows[i]->dev);
		device_del(&mci->csrows[i]->dev);
	}
}
开发者ID:ARMWorks,项目名称:FA_2451_Linux_Kernel,代码行数:23,代码来源:edac_mc_sysfs.c


示例16: usb_gadget_unregister_driver

/*
  Unregister entry point for the peripheral controller driver.
*/
int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
{
	struct lh7a40x_udc *dev = the_controller;
	unsigned long flags;

	if (!dev)
		return -ENODEV;
	if (!driver || driver != dev->driver || !driver->unbind)
		return -EINVAL;

	spin_lock_irqsave(&dev->lock, flags);
	dev->driver = 0;
	stop_activity(dev, driver);
	spin_unlock_irqrestore(&dev->lock, flags);

	driver->unbind(&dev->gadget);
	dev->gadget.dev.driver = NULL;
	device_del(&dev->gadget.dev);

	udc_disable(dev);

	DEBUG("unregistered gadget driver '%s'\n", driver->driver.name);
	return 0;
}
开发者ID:Tigrouzen,项目名称:k1099,代码行数:27,代码来源:lh7a40x_udc.c


示例17: edac_create_sysfs_mci_device

/*
 * Create a new Memory Controller kobject instance,
 *	mc<id> under the 'mc' directory
 *
 * Return:
 *	0	Success
 *	!0	Failure
 */
int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
{
	int i, err;

	/*
	 * The memory controller needs its own bus, in order to avoid
	 * namespace conflicts at /sys/bus/edac.
	 */
	mci->bus.name = kasprintf(GFP_KERNEL, "mc%d", mci->mc_idx);
	if (!mci->bus.name)
		return -ENOMEM;
	edac_dbg(0, "creating bus %s\n", mci->bus.name);
	err = bus_register(&mci->bus);
	if (err < 0)
		return err;

	/* get the /sys/devices/system/edac subsys reference */
	mci->dev.type = &mci_attr_type;
	device_initialize(&mci->dev);

	mci->dev.parent = mci_pdev;
	mci->dev.bus = &mci->bus;
	dev_set_name(&mci->dev, "mc%d", mci->mc_idx);
	dev_set_drvdata(&mci->dev, mci);
	pm_runtime_forbid(&mci->dev);

	edac_dbg(0, "creating device %s\n", dev_name(&mci->dev));
	err = device_add(&mci->dev);
	if (err < 0) {
		bus_unregister(&mci->bus);
		kfree(mci->bus.name);
		return err;
	}

	/*
	 * Create the dimm/rank devices
	 */
	for (i = 0; i < mci->tot_dimms; i++) {
		struct dimm_info *dimm = mci->dimms[i];
		/* Only expose populated DIMMs */
		if (dimm->nr_pages == 0)
			continue;
#ifdef CONFIG_EDAC_DEBUG
		edac_dbg(1, "creating dimm%d, located at ", i);
		if (edac_debug_level >= 1) {
			int lay;
			for (lay = 0; lay < mci->n_layers; lay++)
				printk(KERN_CONT "%s %d ",
					edac_layer_name[mci->layers[lay].type],
					dimm->location[lay]);
			printk(KERN_CONT "\n");
		}
#endif
		err = edac_create_dimm_object(mci, dimm, i);
		if (err) {
			edac_dbg(1, "failure: create dimm %d obj\n", i);
			goto fail;
		}
	}

#ifdef CONFIG_EDAC_LEGACY_SYSFS
	err = edac_create_csrow_objects(mci);
	if (err < 0)
		goto fail;
#endif

#ifdef CONFIG_EDAC_DEBUG
	edac_create_debug_nodes(mci);
#endif
	return 0;

fail:
	for (i--; i >= 0; i--) {
		struct dimm_info *dimm = mci->dimms[i];
		if (dimm->nr_pages == 0)
			continue;
		put_device(&dimm->dev);
		device_del(&dimm->dev);
	}
	put_device(&mci->dev);
	device_del(&mci->dev);
	bus_unregister(&mci->bus);
	kfree(mci->bus.name);
	return err;
}
开发者ID:ARMWorks,项目名称:FA_2451_Linux_Kernel,代码行数:93,代码来源:edac_mc_sysfs.c


示例18: memdev_dev_release

/* Why need this ?*/
static void memdev_dev_release(struct device *dev) {
printk(KERN_INFO "%s is remove\n",dev_name(dev));
	class_destroy(dev->class);
	device_del(dev);
}
开发者ID:zekezang,项目名称:mantis-drivers,代码行数:6,代码来源:memdev-device.c


示例19: edac_mc_sysfs_exit

void __exit edac_mc_sysfs_exit(void)
{
	put_device(mci_pdev);
	device_del(mci_pdev);
	edac_put_sysfs_subsys();
}
开发者ID:ARMWorks,项目名称:FA_2451_Linux_Kernel,代码行数:6,代码来源:edac_mc_sysfs.c


示例20: device_unregister

/**
 *	device_unregister - unregister device from system.
 *	@dev:	device going away.
 *
 *	We do this in two parts, like we do device_register(). First,
 *	we remove it from all the subsystems with device_del(), then
 *	we decrement the reference count via put_device(). If that
 *	is the final reference count, the device will be cleaned up
 *	via device_release() above. Otherwise, the structure will
 *	stick around until the final reference to the device is dropped.
 */
void device_unregister(struct device * dev)
{
	pr_debug("DEV: Unregistering device. ID = '%s'\n", dev->bus_id);
	device_del(dev);
	put_device(dev);
}
开发者ID:kzlin129,项目名称:tt-gpl,代码行数:17,代码来源:core.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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