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

C++ device_destroy函数代码示例

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

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



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

示例1: msm_idle_stats_exit

static void __exit msm_idle_stats_exit(void)
{
	unsigned int nr_cpus = num_possible_cpus();
	int i;

	if (msm_idle_stats_debug_mask & MSM_IDLE_STATS_DEBUG_API)
		pr_info("%s: enter\n", __func__);

	cdev_del(&msm_idle_stats_cdev);

	for (i = nr_cpus - 1; i >= 0; i--)
		device_destroy(
			msm_idle_stats_class, msm_idle_stats_dev_nr + i);

	class_destroy(msm_idle_stats_class);
	unregister_chrdev_region(msm_idle_stats_dev_nr, nr_cpus);

	if (msm_idle_stats_debug_mask & MSM_IDLE_STATS_DEBUG_API)
		pr_info("%s: done\n", __func__);
}
开发者ID:Brainiarc7,项目名称:android_kernel_huawei_u8185,代码行数:20,代码来源:idle_stats.c


示例2: vdin_remove

static int vdin_remove(struct platform_device *pdev)
{
    int i = 0;

    device_remove_file(pdev->dev, &dev_attr_debug);

    unregister_chrdev_region(vdin_devno, VDIN_COUNT);
    for (i = 0; i < VDIN_COUNT; ++i)
    {
        del_timer_sync(&vdin_devp[i]->timer);
        free_irq(vdin_devp[i]->irq,(void *)vdin_devp[i]);
        device_destroy(vdin_clsp, MKDEV(MAJOR(vdin_devno), i));
        cdev_del(&vdin_devp[i]->cdev);
        kfree(vdin_devp[i]);
    }
    class_destroy(vdin_clsp);

    printk(KERN_ERR "vdin: driver removed ok.\n");
    return 0;
}
开发者ID:rofehr,项目名称:aml-original-linux-kernel,代码行数:20,代码来源:vdin.c


示例3: rpigpio_mcleanup

static void __exit
rpigpio_mcleanup(void)
{
	int i = 0;

	for (i = 0; i < PIN_ARRAY_LEN; i++) {
		if (i != 0 && i != 1 && i != 5 && i != 6 &&
			i != 12 && i != 13 && i != 16 && i != 19 &&
			i != 20 && i != 21 && i != 26) {
			std.pin_state_arr[i] = PIN_FREE;
			gpio_free(i);
		}
	}
	free_irq(gpio_to_irq(RPI_GPIO_IN), THIS_MODULE->name);
	device_destroy(std.cls, MKDEV(std.mjr, 0));
	class_destroy(std.cls);
	unregister_chrdev(std.mjr, RPIGPIO_MOD_NAME);

	printk(KERN_NOTICE "[gpio] Removed\n");
}
开发者ID:afshinkdoost,项目名称:gpio-test-module,代码行数:20,代码来源:gpio_test.c


示例4: max77803_led_remove

static int __devexit max77803_led_remove(struct platform_device *pdev)
{
	struct max77803_led_data **led_datas = platform_get_drvdata(pdev);
	int i;

	for (i = 0; i != MAX77803_LED_MAX; ++i) {
		if (led_datas[i] == NULL)
			continue;

		cancel_work_sync(&led_datas[i]->work);
		mutex_destroy(&led_datas[i]->lock);
		led_classdev_unregister(&led_datas[i]->led);
		kfree(led_datas[i]);
	}
	kfree(led_datas);
	device_remove_file(flash_dev, &dev_attr_rear_flash);
	device_destroy(camera_class, 0);
	class_destroy(camera_class);
	return 0;
}
开发者ID:arshull,项目名称:halaszk-UNIVERSAL5420,代码行数:20,代码来源:leds-max77803.c


示例5: ilo_remove

static void ilo_remove(struct pci_dev *pdev)
{
	int i, minor;
	struct ilo_hwinfo *ilo_hw = pci_get_drvdata(pdev);

	clear_device(ilo_hw);

	minor = MINOR(ilo_hw->cdev.dev);
	for (i = minor; i < minor + MAX_CCB; i++)
		device_destroy(ilo_class, MKDEV(ilo_major, i));

	cdev_del(&ilo_hw->cdev);
	ilo_disable_interrupts(ilo_hw);
	free_irq(pdev->irq, ilo_hw);
	ilo_unmap_device(pdev, ilo_hw);
	pci_release_regions(pdev);
	pci_disable_device(pdev);
	kfree(ilo_hw);
	ilo_hwdev[(minor / MAX_CCB)] = 0;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:20,代码来源:hpilo.c


示例6: pwm_driver_exit

static void pwm_driver_exit(void)
{
	int i;
	dev_t devno;
	
	/* キャラクタデバイスの登録解除 */
	for( i = 0; i < PWMDRV_NUM_DEVS; i++ ) {
		cdev_del(&(pwm_driver_cdev_array[i]));
		devno = MKDEV(_pwm_driver_major, _pwm_driver_minor+i);
		device_destroy(pwm_driver_class, devno);
	}
	/* メジャー番号/マイナー番号を取り除く */
	devno = MKDEV(_pwm_driver_major,_pwm_driver_minor);
	unregister_chrdev_region(devno, PWMDRV_NUM_DEVS);	
	class_destroy( pwm_driver_class );

	hrtimer_cancel(&refresh_timer);
	rpi_gpio_unmap();
	kfree(pwm_driver_cdev_array);
}
开发者ID:Tokunn,项目名称:rpi2_pwmdriver,代码行数:20,代码来源:rpi2_pwmdriver.c


示例7: some_exit

static void __exit some_exit(void) {
    printk(KERN_INFO "%s is exiting\n", DRIVER_NAME);

    // Remove the device node
    device_destroy(driver_class, major_numbers);
    class_destroy(driver_class);

    // Delete the driver
    cdev_del(character_device);

    // Free the IRQ
    if (interrupt_registered == 0) {
        free_irq(INTERRUPT_NUMBER, &dev_id);
    }

    // Free the major number
    unregister_chrdev_region(major_numbers, 1);

    printk(KERN_INFO "%s has exited\n", DRIVER_NAME);
}
开发者ID:ThomasvLingen,项目名称:DRVO,代码行数:20,代码来源:lab1_driver.c


示例8: rsz_cleanup

/*
=====================rsz_cleanup===========================
Function	is called by the kernel. It	unregister the device.
*/
static void __exit rsz_cleanup(void)
{

	unregister_chrdev_region(dev, 1);

	device_destroy(rsz_class, dev);

	class_destroy(rsz_class);

	driver_unregister(&resizer_driver);

	/* remove platform device */
	platform_device_unregister(&resizer_device);

	cdev_del(&c_dev);

	/* unregistering the driver     from the kernel */
	unregister_chrdev(MAJOR(dev), DRIVER_NAME);

}				/* End  of function   resizer_cleanup */
开发者ID:GeorgeIoak,项目名称:linux-davinci,代码行数:24,代码来源:imp_resizer.c


示例9: adc_remove

static int adc_remove(struct platform_device *pdev)
{
	struct kp *kp = platform_get_drvdata(pdev);

	input_unregister_device(kp->input_keytouch);
	input_unregister_device(kp->input_joystick);
	input_free_device(kp->input_keytouch);
	input_free_device(kp->input_joystick);

	unregister_chrdev(kp->config_major,kp->config_name);
	if(kp->config_class)
	{
		if(kp->config_dev)
			device_destroy(kp->config_class,MKDEV(kp->config_major,0));
		class_destroy(kp->config_class);
	}
	kfree(kp);
	gp_kp=NULL ;
	return 0;
}
开发者ID:32743069,项目名称:amlogic_common_3050,代码行数:20,代码来源:adc_js.c


示例10: my_exit

/*****************************************EXIT**************************************************/
static void my_exit(void)
{
   int i;
   dev_t devno = MKDEV(dev_major, dev_minor);
   
   
   if (dev_devices) {
      for (i = 0; i < NUM_DEVICES; i++) {
    kfree(dev_devices[i].ramdisk);
    cdev_del(&dev_devices[i].dev);
    device_destroy(foo_class, MKDEV(MAJOR(devno), MINOR(devno) + i));
      }
      kfree(dev_devices);
      class_destroy(foo_class);
   }
  
   
   unregister_chrdev_region(devno, NUM_DEVICES);
   printk("DEVICE MODULE UNREGISTERED FROM DEV!\n");
}
开发者ID:harish-agr,项目名称:Char_driver,代码行数:21,代码来源:char_driver_skelton.c


示例11: gps_gpio_exit

//  ************************************************************ //
//  Device Exit :
//
//  
//  ************************************************************ //
static void __exit gps_gpio_exit(void)  
{  

    gps_dbg("gps_gpio_exit");
	
    device_destroy(gps_class, MKDEV(gps_major, 0));
    class_destroy(gps_class);

    cdev_del(&gps_cdev);
    unregister_chrdev_region(dev, 1);

#if defined(CONFIG_MACH_TCC9300) || defined(CONFIG_MACH_TCC8800) || defined(CONFIG_MACH_TCC8920)
    // GPS Power off
    gps_dbg("GPS_PWREN off");
    if(machine_is_m801_88() || machine_is_m803()) // demo set
    {
        gpio_set_value(TCC_GPG(4), 0);
    }
    else if(machine_is_tcc8800() || machine_is_tcc8920())
    {
        gpio_direction_output(TCC_GPEXT1(6), 0);
    }
#elif defined(CONFIG_MACH_TCC8900)
    if(machine_is_tcc8900())    
    {
        gps_dbg("GPS_8900_PWREN off");
        gpio_set_value(TCC_GPD(25), 0);
    }
#elif defined(CONFIG_MACH_M805_892X)
    // GPS Power off
    gps_dbg("GPS_PWREN off");
    if(machine_is_m805_892x())
    {
		if (system_rev == 0x2002 || system_rev == 0x2003 || system_rev == 0x2004 || system_rev == 0x2005)
			gpio_set_value(TCC_GPE(14), 0);
		else
			gpio_set_value(TCC_GPC(6), 0);
    }
#endif
    gps_dbg("GPS driver unloaded");
}  
开发者ID:AmesianX,项目名称:telechips-linux,代码行数:46,代码来源:gpio.c


示例12: init_gpio

static int init_gpio(void)
{

	init_result = alloc_chrdev_region( &first, 0, 1, "gpio_drv" );

	if( 0 > init_result )
	{
		printk( KERN_ALERT "Device Registration failed\n" );
		return -1;
	}
	printk("Major Nr: %d\n", MAJOR(first));

	if ( (cl = class_create( THIS_MODULE, "gpiodrv" ) ) == NULL )
	{
		printk( KERN_ALERT "Class creation failed\n" );
		unregister_chrdev_region( first, 1 );
		return -1;
	}

	if( device_create( cl, NULL, first, NULL, "gpio_drv%d", 0) == NULL )
	{
		printk( KERN_ALERT "Device creation failed\n" );
		class_destroy(cl);
		unregister_chrdev_region( first, 1 );
		return -1;
	}

	cdev_init( &c_dev, &FileOps );

	if( cdev_add( &c_dev, first, 1 ) == -1)
	{
		printk( KERN_ALERT "Device addition failed\n" );
		device_destroy( cl, first );
		class_destroy( cl );
		unregister_chrdev_region( first, 1 );
		return -1;
	}

	return 0;

}
开发者ID:sysplay,项目名称:bbb,代码行数:41,代码来源:gpio.c


示例13: cmdq_exit

static void __exit cmdq_exit(void)
{
	int32_t status;

	CMDQ_MSG("CMDQ driver exit begin\n");

	device_destroy(gCMDQClass, gCmdqDevNo);

	class_destroy(gCMDQClass);

	cdev_del(gCmdqCDev);

	gCmdqCDev = NULL;

	unregister_chrdev_region(gCmdqDevNo, 1);

	platform_driver_unregister(&gCmdqDriver);

	/* register pm notifier */
	status = unregister_pm_notifier(&cmdq_pm_notifier_block);
	if (0 != status) {
		CMDQ_ERR("Failed to unregister_pm_notifier(%d)\n", status);
	}

	/* Unregister MDP callback */
	cmdqCoreRegisterCB(CMDQ_GROUP_MDP, NULL, NULL, NULL, NULL);

	/* Unregister VENC callback */
	cmdqCoreRegisterCB(CMDQ_GROUP_VENC, NULL, NULL, NULL, NULL);

	/* De-Initialize group callback */
	cmdqCoreDeinitGroupCB();

	/* De-Initialize cmdq core */
	cmdqCoreDeInitialize();

	/* De-Initialize cmdq dev related data */
	cmdq_dev_deinit();

	CMDQ_MSG("CMDQ driver exit end\n");
}
开发者ID:nxglabs,项目名称:mt6735-kernel-3.10.61,代码行数:41,代码来源:cmdq_driver.c


示例14: add_typec_device

int add_typec_device(struct device *parent, struct typec_device_ops *typec_ops)
{
	struct device *dev;
	struct device_attribute **attrs = typec_attributes;
	struct device_attribute *attr;
	int err;

	if (!typec_ops || !typec_ops->current_detect
	    || !typec_ops->attached_state_detect
	    || !typec_ops->current_advertise_get
	    || !typec_ops->current_advertise_set || !typec_ops->port_mode_get
	    || !typec_ops->port_mode_set || !typec_ops->dump_regs) {
		pr_err("%s: ops is NULL\n", __func__);
		return -1;
	}

	dev = device_create(typec_class, NULL, MKDEV(0, 0), typec_ops,
			    "typec_device");
	if (IS_ERR(dev)) {
		pr_err("%s: device_create fail\n", __func__);
		return -1;
	}

	while ((attr = *attrs++)) {
		err = device_create_file(dev, attr);
		if (err) {
			pr_err("%s: device_create_file fail\n", __func__);
			device_destroy(typec_class, dev->devt);
			return -1;
		}
	}

	typec_dev = dev;

	usb_psy = power_supply_get_by_name("usb");
	if (!usb_psy) {
		pr_err("%s USB supply not found\n", __func__);
	}

	return 0;
}
开发者ID:tommytarts,项目名称:Quantum-6P,代码行数:41,代码来源:typec-core.c


示例15: btwlan_em_exit

static void __exit btwlan_em_exit(void)
{
    BTWLAN_EM_DEBUG("btwlan_em_exit ++\n");
    
    if (pbtwlan_em){
        cdev_del(&pbtwlan_em->cdev);
        
        unregister_chrdev_region(pbtwlan_em->dev_t, 1);
        device_destroy(pbtwlan_em->cls, pbtwlan_em->dev_t);
        
        class_destroy(pbtwlan_em->cls);
        mutex_destroy(&pbtwlan_em->sem);
        
        kfree(pbtwlan_em);
        pbtwlan_em = NULL;
        
        BTWLAN_EM_DEBUG("btwlan_em_exit release source\n");
    }
    
    BTWLAN_EM_DEBUG("btwlan_em_exit --\n");
}
开发者ID:5C4R4B3,项目名称:CINK_SLIM_ICS_Opensource,代码行数:21,代码来源:btwlanem.c


示例16: omap_rproc_remove

static int omap_rproc_remove(struct platform_device *pdev)
{
	int major = MAJOR(omap_rproc_dev);
	struct device *dev = &pdev->dev;
	struct omap_rproc_platform_data *pdata = dev->platform_data;
	struct omap_rproc *rproc = platform_get_drvdata(pdev);

	if (!pdata || !rproc)
		return -EINVAL;

	dev_info(dev, "%s removing %s, major: %d, base-minor: %d\n",
			OMAP_RPROC_NAME,
			pdata->name,
			major,
			rproc->minor);

	device_destroy(omap_rproc_class, MKDEV(major, rproc->minor));
	cdev_del(&rproc->cdev);

	return 0;
}
开发者ID:egonalter,项目名称:R-Link_kernel,代码行数:21,代码来源:remoteproc.c


示例17: vfd_remove

static int vfd_remove(struct platform_device *pdev)
{
	  struct vfd *vfd = platform_get_drvdata(pdev);
	   /* unregister everything */
    input_unregister_device(vfd->input);
		device_remove_file(&pdev->dev, &dev_attr_key);
    device_remove_file(&pdev->dev, &dev_attr_led);
    
		input_free_device(vfd->input);
    unregister_chrdev(vfd->config_major,vfd->config_name);
    if(vfd->config_class)
    {
        if(vfd->config_dev)
        device_destroy(vfd->config_class,MKDEV(vfd->config_major,0));
        class_destroy(vfd->config_class);
    }       
    kfree(vfd);
    gp_vfd = NULL ;
    return 0;	
	
}
开发者ID:CoreTech-Development,项目名称:buildroot-linux-kernel,代码行数:21,代码来源:vfd.c


示例18: SqueueDevDriverExit

/*
 * Driver Deinitialization
 */
void __exit SqueueDevDriverExit(void)
{
	unsigned char LoopIndex = 0;/* for looping through all the devices */

	for (LoopIndex = 0; LoopIndex < NUMBER_OF_DEVICES; LoopIndex++)
	{
	   /* Destroy the devices first */
	   device_destroy(SqueueDevClass, (MKDEV(MAJOR(SqueueDevNumber),LoopIndex)));
	   /* Delete each of the cdevs */
	   cdev_del(&((&(SqueueBus[LoopIndex]))->cdev));
	}
	/* Free up the allocated memory for all of the device */
	 kfree(SqueueBus);
	/* Remove the device class that was created earlier */
	class_destroy(SqueueDevClass);
	
	/* Unregister devices */
	unregister_chrdev_region(MKDEV(MAJOR(SqueueDevNumber), 0), NUMBER_OF_DEVICES);
	
	printk(" All Squeue devices and driver are removed ! ");
}
开发者ID:BrahmeshJain,项目名称:Project1,代码行数:24,代码来源:Squeue.c


示例19: uio_unregister_device

/**
 * uio_unregister_device - unregister a industrial IO device
 * @info:	UIO device capabilities
 *
 */
void uio_unregister_device(struct uio_info *info)
{
	struct uio_device *idev;

	if (!info || !info->uio_dev)
		return;

	idev = info->uio_dev;

	uio_free_minor(idev);

	if (info->irq && (info->irq != UIO_IRQ_CUSTOM))
		free_irq(info->irq, idev);

	uio_dev_del_attributes(idev);

	device_destroy(&uio_class, MKDEV(uio_major, idev->minor));
	kfree(idev);

	return;
}
开发者ID:kamarush,项目名称:caf_kernel_mm,代码行数:26,代码来源:uio.c


示例20: WIFI_exit

static void WIFI_exit(void)
{
	dev_t dev = MKDEV(WIFI_major, 0);
//    retflag = 0;
	if(pWIFIDev)
	{
		device_destroy(pWIFIClass, dev);
		pWIFIDev = NULL;
	}

	if(pWIFIClass)
	{
		class_destroy(pWIFIClass);
		pWIFIClass = NULL;
	}

	cdev_del(&WIFI_cdev);
	unregister_chrdev_region(dev, WIFI_devs);

	WIFI_INFO_FUNC("%s driver removed.\n", WIFI_DRIVER_NAME);
}
开发者ID:23171580,项目名称:ralink,代码行数:21,代码来源:mt_wifi_chrdev.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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