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__);
}
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;
}
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");
}
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;
}
Beispiel #5
0
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;
}
Beispiel #6
0
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);
}
Beispiel #7
0
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);
}
Beispiel #8
0
/*
=====================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 */
Beispiel #9
0
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;
}
/*****************************************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");
}
Beispiel #11
0
//  ************************************************************ //
//  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");
}  
Beispiel #12
0
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;

}
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");
}
Beispiel #14
0
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;
}
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");
}
Beispiel #16
0
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;
}
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;	
	
}
Beispiel #18
0
/*
 * 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 ! ");
}
Beispiel #19
0
/**
 * 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;
}
Beispiel #20
0
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);
}
Beispiel #21
0
static void drv_exit(void)
#endif
{
    gcmkHEADER();

    gcmkASSERT(gpuClass != gcvNULL);
    device_destroy(gpuClass, MKDEV(major, 0));
    class_destroy(gpuClass);

    unregister_chrdev(major, DEVICE_NAME);

    gcmkVERIFY_OK(gckGALDEVICE_Stop(galDevice));
    gcmkVERIFY_OK(gckGALDEVICE_Destroy(galDevice));

    if(gckDEBUGFS_IsEnabled())
    {
        gckDEBUGFS_Terminate();
    }

    gcmkFOOTER_NO();
}
Beispiel #22
0
static int __devexit elmo_remove(struct platform_device *pdev)
{
	extern void gpio_wan_exit(void *);

	log_debug("elmo_remove::removing elmo device\n");
	wan_set_power_status(WAN_INVALID);

	/* clear the PMIC event handler */
	pmic_power_event_unsub(PWR_IT_ONOFD2I, wan_tph_notify);

	if (wan_dev != NULL) {
		device_destroy(wan_class, MKDEV(wan_major, 0));
		wan_dev = NULL;
		class_destroy(wan_class);
		unregister_chrdev(wan_major, WAN_STRING_DEV);
	}
	free_irq(gpio_wan_fw_ready_irq(),NULL);
	free_irq(gpio_wan_mhi_irq(),NULL);

	return 0;
}
Beispiel #23
0
static void cleanup(void)
{
	int i;
	unsigned long flags;

	spin_lock_irqsave(&dgnc_poll_lock, flags);
	dgnc_poll_stop = 1;
	spin_unlock_irqrestore(&dgnc_poll_lock, flags);

	/* Turn off poller right away. */
	del_timer_sync(&dgnc_poll_timer);

	device_destroy(dgnc_class, MKDEV(dgnc_major, 0));
	class_destroy(dgnc_class);
	unregister_chrdev(dgnc_major, "dgnc");

	for (i = 0; i < dgnc_num_boards; ++i) {
		dgnc_cleanup_tty(dgnc_board[i]);
		dgnc_cleanup_board(dgnc_board[i]);
	}
}
Beispiel #24
0
static void audiodev_cleanup_module(int device_added)
{
	dev_t devno = MKDEV(audiostub_major, audiostub_minor);
	int i;

	deinit_audioport();

	/* Get rid of our char dev entries */
	if (audiodev_devices) {
		for (i = 0; i < device_added; i++) {
			cdev_del(&audiodev_devices[i]);
			device_destroy(audiodev_class,
				       MKDEV(audiostub_major,
					     audiostub_minor + i));
		}
		kfree(audiodev_devices);
	}

	class_destroy(audiodev_class);
	unregister_chrdev_region(devno, AUDIO_DEVICE_CNT);
}
Beispiel #25
0
/**
 * exm_unregister_device - unregister a industrial IO device
 * @info:	EXM device capabilities
 *
 */
void exm_unregister_device(struct exm_info *info)
{
	struct exm_device *idev;

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

	idev = info->exm_dev;

	exm_free_minor(idev);

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

	exm_dev_del_attributes(idev);

	device_destroy(&exm_class, MKDEV(exm_major, idev->minor));
	kfree(idev);

	return;
}
Beispiel #26
0
static int __devexit bfspi_release()
{
	//struct bfspi_data	*bfspi = (struct bfspi_data	*)spi->drv_data;

	/* make sure ops on existing fds can abort cleanly */
	//spin_lock_irq(&bfspi->spi_lock);
	//bfspi->spi = NULL;
	//spi_set_drvdata(spi, NULL);
	//spin_unlock_irq(&bfspi->spi_lock);

	/* prevent new opens */
	mutex_lock(&device_list_lock);
	//list_del(&bfspi->device_entry);
	device_destroy(bfspi_class, bfspi->devt);
	clear_bit(MINOR(bfspi->devt), minors);
	if (bfspi->users == 0)
		kfree(bfspi);
	mutex_unlock(&device_list_lock);

	return 0;
}
Beispiel #27
0
static int __devinit ldm4_probe(struct platform_device *dev)
{
	int ret;

	PRINT();

	if (0 == dev_cnt) {
		major = register_chrdev(0, "ldm4", &ldm4_fops);
		if (major < 0) {
			return major;
		}

		ldm4_cls = class_create(THIS_MODULE, "ldm4");
		if (NULL == ldm4_cls) {
			ret = -1;
			goto class_create_err;
		}
	}

	ldm4_dev[dev_cnt] = device_create(ldm4_cls, NULL, MKDEV(major, dev_cnt), NULL, "%s", dev->name);
	if (NULL == ldm4_dev[dev_cnt]) {
		ret = -1;
		goto device_create_err;
	}

	dev_cnt++;

	return 0;

device_create_err:
	while (dev_cnt > 0) {
		device_destroy(ldm4_cls, MKDEV(major, dev_cnt - 1));
		dev_cnt--;
	}
	class_destroy(ldm4_cls);
class_create_err:
	unregister_chrdev(major, "ldm4");

	return ret;
}
int switch_dev_register(struct switch_dev *sdev)
{
	int ret;

	if (!switch_class) {
		ret = create_switch_class();
		if (ret < 0)
			return ret;
	}

	sdev->index = atomic_inc_return(&device_count);
	sdev->dev = device_create(switch_class, NULL,
		MKDEV(0, sdev->index), NULL, sdev->name);
	if (IS_ERR(sdev->dev))
		return PTR_ERR(sdev->dev);

	ret = device_create_file(sdev->dev, &dev_attr_state);
	if (ret < 0)
		goto err_create_file_1;
	ret = device_create_file(sdev->dev, &dev_attr_name);
	if (ret < 0)
		goto err_create_file_2;
	ret = device_create_file(sdev->dev, &dev_attr_gps_en);
	if (ret < 0)
		goto err_create_file_1;
	ret = device_create_file(sdev->dev, &dev_attr_gps_rst);
	if (ret < 0)
		goto err_create_file_1;
	dev_set_drvdata(sdev->dev, sdev);
	sdev->state = 0;
	return 0;

err_create_file_2:
	device_remove_file(sdev->dev, &dev_attr_state);
err_create_file_1:
	device_destroy(switch_class, MKDEV(0, sdev->index));
	printk(KERN_ERR "switch: Failed to register driver %s\n", sdev->name);

	return ret;
}
static void drv_exit(void)
#endif
{
    gcmkHEADER();

#ifdef CONFIG_ANDROID_RESERVED_MEMORY_ACCOUNT
    task_free_unregister(&task_nb);
    unregister_reserved_memory_account(&viv_gpu_resmem_handler);
#endif

    gcmkASSERT(gpuClass != gcvNULL);
    device_destroy(gpuClass, MKDEV(major, 0));
    class_destroy(gpuClass);

    unregister_chrdev(major, DRV_NAME);

    gcmkVERIFY_OK(gckGALDEVICE_Stop(galDevice));
    gcmkVERIFY_OK(gckGALDEVICE_Destroy(galDevice));

   if(gckDebugFileSystemIsEnabled())
   {
   	 gckDebugFileSystemTerminate();
   }

#if ENABLE_GPU_CLOCK_BY_DRIVER && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,28)
    {
# if 0
        struct clk * clk = NULL;

#if defined(CONFIG_PXA_DVFM) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,29))
        gc_pwr(0);
#endif
        clk = clk_get(NULL, "GCCLK");
        clk_disable(clk);
# endif
    }
#endif

    gcmkFOOTER_NO();
}
static void WMT_exit(void)
{
	dev_t dev = MKDEV(gWmtMajor, 0);

#if CONSYS_EARLYSUSPEND_ENABLE
    unregister_early_suspend(&wmt_early_suspend_handler);
    osal_sleepable_lock_deinit(&g_es_lr_lock);
    WMT_INFO_FUNC("unregister_early_suspend finished\n");
#endif

#if CONSYS_WMT_REG_SUSPEND_CB_ENABLE
	unregister_pm_notifier(&wmt_pm_notifier_block);
#endif
    wmt_lib_deinit();
    
#if CFG_WMT_DBG_SUPPORT
	wmt_dev_dbg_remove();
#endif

#if CFG_WMT_PROC_FOR_AEE
	wmt_dev_proc_for_aee_remove();
#endif

	cdev_del(&gWmtCdev);
	unregister_chrdev_region(dev, WMT_DEV_NUM);
	gWmtMajor = -1;
#if REMOVE_MK_NODE
	device_destroy(wmt_class, MKDEV(gWmtMajor, 0));
	class_destroy(wmt_class);
	wmt_class = NULL;
#endif
#ifdef MTK_WMT_WAKELOCK_SUPPORT
	WMT_WARN_FUNC("destroy func_on_off_wake_lock\n");
	wake_lock_destroy(&func_on_off_wake_lock);
#endif

	stp_drv_exit();

	WMT_INFO_FUNC("done\n");
}