当前位置: 首页>>代码示例>>C++>>正文


C++ device_del函数代码示例

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


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


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