예제 #1
0
/* Called by modules package when removing the driver 
 */
void cleanup_module(void)
{
	int i;
	char devname[9];

	TRACE_FUN(ft_t_flow);

	if (devfs_unregister_chrdev(QIC117_TAPE_MAJOR, "zft") != 0) {
		TRACE(ft_t_warn, "failed");
	} else {
		TRACE(ft_t_info, "successful");
	}
        for (i = 0; i < 4; i++) {
		sprintf(devname, "qft%i", i);
		devfs_unregister(devfs_find_handle(NULL, devname, QIC117_TAPE_MAJOR, i, DEVFS_SPECIAL_CHR, 0));
		sprintf(devname, "nqft%i", i);
		devfs_unregister(devfs_find_handle(NULL, devname, QIC117_TAPE_MAJOR, i + 4, DEVFS_SPECIAL_CHR, 0));
		sprintf(devname, "zqft%i", i);
		devfs_unregister(devfs_find_handle(NULL, devname, QIC117_TAPE_MAJOR, i + 16, DEVFS_SPECIAL_CHR, 0));
		sprintf(devname, "nzqft%i", i);
		devfs_unregister(devfs_find_handle(NULL, devname, QIC117_TAPE_MAJOR, i + 20, DEVFS_SPECIAL_CHR, 0));
		sprintf(devname, "rawqft%i", i);
		devfs_unregister(devfs_find_handle(NULL, devname, QIC117_TAPE_MAJOR, i + 32, DEVFS_SPECIAL_CHR, 0));
		sprintf(devname, "nrawqft%i", i);
		devfs_unregister(devfs_find_handle(NULL, devname, QIC117_TAPE_MAJOR, i + 36, DEVFS_SPECIAL_CHR, 0));
	}
	zft_uninit_mem(); /* release remaining memory, if any */
        printk(KERN_INFO "zftape successfully unloaded.\n");
	TRACE_EXIT;
}
예제 #2
0
void cleanup_module(void)
{
	devfs_unregister (devfs_handle);
	if (devfs_unregister_chrdev( MAJOR_NR, "slm" ) != 0)
		printk( KERN_ERR "acsi_slm: cleanup_module failed\n");
	atari_stram_free( SLMBuffer );
}
void __exit h3600_stowaway_cleanup_module( void )
{
	unregister_sysctl_table(h3600_stowaway_sysctl_header);
	remove_proc_entry(H3600_STOWAWAY_PROC_STATS, proc_dir);

	devfs_unregister( devfs_stowaway );
	devfs_unregister_chrdev( g_stowaway_major, H3600_STOWAWAY_MODULE_NAME );
}
예제 #4
0
static void __exit gfx_inf_deinit(void)
{
    devfs_unregister_chrdev(GFX_DEV_MAJOR, GFX_DRIVER_NAME);
    if(devfs_handle != NULL)
      devfs_unregister(devfs_handle);
    gfx_inf_h_deinit(2);
    gfx_atom_deinit();  // BJC 102102
}
예제 #5
0
void PpeUnRegIoctlHandler(void)
{
#ifdef  CONFIG_DEVFS_FS
    devfs_unregister_chrdev(hw_nat_major, HW_NAT_DEVNAME);
    devfs_unregister(devfs_handle);
#else
    unregister_chrdev(hw_nat_major, HW_NAT_DEVNAME);
#endif
}
예제 #6
0
파일: linux_gpio.c 프로젝트: cilynx/dd-wrt
static void __exit
gpio_exit(void)
{
int i;
	for (i = 0; i < ARRAYSIZE(gpio_file); i++)
		devfs_unregister(gpio_file[i].handle);
	devfs_unregister(gpio_dir);
	devfs_unregister_chrdev(gpio_major, "gpio");
	sb_detach(gpio_sbh);}
예제 #7
0
void __exit ms77xxxx_led_cleanup(void)
{
	devfs_unregister_chrdev(LED_MAJOR, LED_NAME);

#if defined(CONFIG_SH_7760_SOLUTION_ENGINE)
	printk(KERN_INFO "MS7760CP01 LED driver removed.\n"); 
#else
#error No Platform
#endif
}
static void __exit cleanup_mtdchar(void)
{
#ifdef CONFIG_DEVFS_FS
	unregister_mtd_user(&notifier);
	devfs_unregister(devfs_dir_handle);
	devfs_unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
#else
	unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
#endif
}
예제 #9
0
void AclUnRegIoctlHandler(void)
{

#ifdef  CONFIG_DEVFS_FS
    devfs_unregister_chrdev(acl_major, ACL_DEVNAME);
    devfs_unregister(devfs_handle);
#else
    unregister_chrdev(acl_major, ACL_DEVNAME);
#endif

}
예제 #10
0
int __init h3600_backpaq_fpga_init_module(void)    
{    
	int result;    
	printk(KERN_ALERT __FILE__ ": registering char device");    

	/* Register my device driver */
	result = devfs_register_chrdev(0,MODULE_NAME, &h3600_backpaq_fpga_fops);    
	if ( result <= 0 ) {
		printk(" can't get major number\n");
		return result;    
	}    
	if ( h3600_backpaq_fpga_major_num == 0 )
		h3600_backpaq_fpga_major_num = result;
	printk(" %d\n", h3600_backpaq_fpga_major_num);

	/* Clear the default structure */
 	memset(&h3600_backpaq_fpga_data, 0, sizeof(struct h3600_backpaq_fpga_dev_struct));

	/* Create a devfs entry */
#ifdef CONFIG_DEVFS_FS
	devfs_fpga = devfs_register( NULL, FPGA_DEVICE_NAME, DEVFS_FL_DEFAULT,
				       h3600_backpaq_fpga_major_num, FPGA_MINOR,
				       S_IFCHR | S_IRUSR | S_IWUSR, 
				       &h3600_backpaq_fpga_fops, NULL );
#endif

#ifdef CONFIG_PROC_FS
	/* Set up the PROC file system entry */
	proc_backpaq_fpga = create_proc_entry(FPGA_PROC_NAME, 0, NULL);
	if ( !proc_backpaq_fpga ) {
		/* We probably need to create the "backpaq" directory first */
		proc_mkdir(FPGA_PROC_DIR,0);
		proc_backpaq_fpga = create_proc_entry(FPGA_PROC_NAME, 0, NULL);
	}
	
	if ( proc_backpaq_fpga )
		proc_backpaq_fpga->read_proc = proc_h3600_backpaq_read;    
	else {
		printk(KERN_ALERT __FILE__ ": unable to create proc entry %s\n", FPGA_PROC_NAME);
		devfs_unregister( devfs_fpga );
		devfs_unregister_chrdev( h3600_backpaq_fpga_major_num, MODULE_NAME );
		return -ENODEV;
	}
#endif

#ifdef CONFIG_PM
	fpga_backpaq_dev = h3600_backpaq_register_device( H3600_BACKPAQ_FPGA_DEV, 0, 
							  h3600_backpaq_fpga_callback );
	printk(KERN_ALERT __FILE__ ": registered backpaq callback=%p\n", h3600_backpaq_fpga_callback);
#endif

	return 0;    
} 
예제 #11
0
파일: rdm.c 프로젝트: JBTech/ralink_rt5350
static void rdm_exit(void)
{
    printk("rdm_exit\n");

#ifdef  CONFIG_DEVFS_FS
    devfs_unregister_chrdev(rdm_major, RDM_DEVNAME);
    devfs_unregister(devfs_handle);
#else
    unregister_chrdev(rdm_major, RDM_DEVNAME);
#endif

}
예제 #12
0
void cleanup_module(void)
{
	struct vfc_dev **devp;

	devfs_unregister_chrdev(VFC_MAJOR,vfcstr);

	for (devp = vfc_dev_lst; *devp; devp++)
		deinit_vfc_device(*devp);

	devfs_unregister (devfs_handle);
	kfree(vfc_dev_lst);
	return;
}
예제 #13
0
static void __exit capi_exit(void)
{
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
	unsigned int j;
#endif
	alloc_exit();
	(void)proc_exit();

	devfs_unregister_chrdev(capi_major, "capi20");
	devfs_unregister(devfs_find_handle(NULL, "isdn/capi20", capi_major, 0, DEVFS_SPECIAL_CHR, 0));

#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
	capinc_tty_exit();
	devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
	for (j = 0; j < CAPINC_NR_PORTS; j++) {
		char devname[32];
		sprintf(devname, "capi/r%u", j);
		devfs_unregister(devfs_find_handle(NULL, devname, capi_rawmajor, j, DEVFS_SPECIAL_CHR, 0));
	}
#endif
	(void) detach_capi_interface(&cuser);
	printk(KERN_NOTICE "capi: Rev %s: unloaded\n", rev);
}
예제 #14
0
파일: dtlk.c 프로젝트: niubl/camera_project
static void __exit dtlk_cleanup (void)
{
    dtlk_write_bytes("goodbye", 8);
    current->state = TASK_INTERRUPTIBLE;
    schedule_timeout(5 * HZ / 10);		/* nap 0.50 sec but
						   could be awakened
						   earlier by
						   signals... */

    dtlk_write_tts(DTLK_CLEAR);
    devfs_unregister_chrdev(dtlk_major, "dtlk");
    devfs_unregister(devfs_handle);
    release_region(dtlk_port_lpc, DTLK_IO_EXTENT);
}
예제 #15
0
파일: i2s_ctrl.c 프로젝트: jhbsz/wifiaudio
void i2s_mod_exit(void)
{
		
#ifdef  CONFIG_DEVFS_FS
    devfs_unregister_chrdev(i2sdrv_major, I2SDRV_DEVNAME);
    devfs_unregister(devfs_handle);
#else
    unregister_chrdev(i2sdrv_major, I2SDRV_DEVNAME);
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,35)
#else
	device_destroy(i2smodule_class,MKDEV(i2sdrv_major, 0));
	class_destroy(i2smodule_class); 
#endif	
	return ;
}
예제 #16
0
void cleanup_module(void)
{
	int ret;
	
#ifndef LIRC_HAVE_DEVFS
 	ret = unregister_chrdev(IRCTL_DEV_MAJOR, IRCTL_DEV_NAME);
#else
	ret = devfs_unregister_chrdev(IRCTL_DEV_MAJOR, IRCTL_DEV_NAME);
#endif
 
	if (0 > ret){
		printk("lirc_dev: error in module_unregister_chrdev: %d\n",
		       ret);
	} else {
		dprintk("lirc_dev: module successfully unloaded\n");
	}
}
예제 #17
0
void __exit h3600_backpaq_fpga_exit_module(void)
{
	printk(KERN_ALERT __FILE__ ": exit\n");

#ifdef CONFIG_PM
        h3600_backpaq_unregister_device(fpga_backpaq_dev);
#endif
#ifdef CONFIG_PROC_FS
	if (proc_backpaq_fpga) {
		remove_proc_entry(FPGA_PROC_NAME, 0);
		proc_backpaq_fpga = NULL;
	}
#endif
#ifdef CONFIG_DEVFS_FS
	devfs_unregister( devfs_fpga );
#endif
	devfs_unregister_chrdev( h3600_backpaq_fpga_major_num, MODULE_NAME );
}
예제 #18
0
/* Cleanup - unregister the appropriate file from /proc */
void aud_cleanup_module()
{
    int ret;
    int i;

    /* Unregister the device */
    ret = devfs_unregister_chrdev(MAJOR_NUM_ADEC, DEVICE_NAME_ADEC);
    if (ret < 0)
        printk("Error in module_unregister_chrdev: %d\n", ret);

    for(i = 0; i < no_devnodes; i++)
    {
      if(devnodes[i].devfs_handle != NULL)
        devfs_unregister(devnodes[i].devfs_handle);

    }

}
예제 #19
0
static void __exit
wps_led_exit(void)
{
#ifndef CONFIG_DEVFS_FS

#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36)
    int ret_val;
    ret_val = unregister_chrdev(WPS_LED_MAJOR_NUM, "wps_led");
#else
	unregister_chrdev(WPS_LED_MAJOR_NUM, "wps_led");
#endif    
#else /* CONFIG_DEVFS_FS */
    if (wps_leddev_handle != NULL)
        devfs_unregister(wps_leddev_handle);
    wps_leddev_handle = NULL;
    devfs_unregister_chrdev(wps_led_major, "wps_led");
#endif /* CONFIG_DEVFS_FS */
}
예제 #20
0
파일: adapter.c 프로젝트: leonsh/eldk30ppc
static void			/* __exit removed because xts_init calls this */
xts_cleanup(void)
{
	while (dev_list)
		remove_head_dev();

	if (xts_task) {
		task_shutdown = 1;
		send_sig(SIGKILL, xts_task, 1);
		wait_for_completion(&task_sync);
	}
	if (devfs_dir) {
		devfs_unregister(devfs_dir);
		devfs_dir = NULL;
	}
	if (devfs_unregister_chrdev(xts_major, XTS_NAME) != 0)
		printk(KERN_ERR "%s: unable to release major %d.\n",
		       XTS_NAME, xts_major);
}
예제 #21
0
파일: dazuko_rsbac.c 프로젝트: eqmcc/dazuko
inline int xp_sys_unhook()
{
	/* Called by rmmod when removing the module. */

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
	unregister_chrdev(dev_major, DEVICE_NAME);

	devfs_remove(DEVICE_NAME);
#else
	#ifdef CONFIG_DEVFS_FS
		devfs_unregister_chrdev(dev_major, DEVICE_NAME);
		devfs_unregister(devfs_find_handle(NULL, DEVICE_NAME, dev_major, 0, DEVFS_SPECIAL_CHR, 0));
	#else
		unregister_chrdev(dev_major, DEVICE_NAME);
	#endif
#endif

	return 0;
}
예제 #22
0
/* cleanup module */
void __exit sci_module_cleanup(void)
{
  int i;
  
    sci_osd_uninit();

    /* unregister the device */
    if (devfs_unregister_chrdev(MAJOR_NUM, DEVICE_NAME) < 0)
    {
        PDEBUG("error in module_unregister_chrdev\n");
    }

    for(i = 0; i < no_devnodes; i++)
    {
      if(devnodes[i].devfs_handle != NULL)
        devfs_unregister(devnodes[i].devfs_handle);

    }

}
예제 #23
0
static void __exit
gpio_exit(void)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
	if (gpiodev_class != NULL) {
		class_device_destroy(gpiodev_class, MKDEV(gpio_major, 0));
		class_destroy(gpiodev_class);
	}

	gpiodev_class = NULL;
	if (gpio_major >= 0)
		unregister_chrdev(gpio_major, "gpio");
#else
	if (gpiodev_handle != NULL)
		devfs_unregister(gpiodev_handle);
	gpiodev_handle = NULL;
	devfs_unregister_chrdev(gpio_major, "gpio");
#endif
	si_detach(gpio_sih);
}
예제 #24
0
int slm_init( void )

{
	if (devfs_register_chrdev( MAJOR_NR, "slm", &slm_fops )) {
		printk( KERN_ERR "Unable to get major %d for ACSI SLM\n", MAJOR_NR );
		return -EBUSY;
	}
	
	if (!(SLMBuffer = atari_stram_alloc( SLM_BUFFER_SIZE, "SLM" ))) {
		printk( KERN_ERR "Unable to get SLM ST-Ram buffer.\n" );
		devfs_unregister_chrdev( MAJOR_NR, "slm" );
		return -ENOMEM;
	}
	BufferP = SLMBuffer;
	SLMState = IDLE;
	
	devfs_handle = devfs_mk_dir (NULL, "slm", NULL);
	devfs_register_series (devfs_handle, "%u", MAX_SLM, DEVFS_FL_DEFAULT,
			       MAJOR_NR, 0, S_IFCHR | S_IRUSR | S_IWUSR,
			       &slm_fops, NULL);
	return 0;
}
예제 #25
0
static void ra_nvram_exit(void)
{
	int index;
	
	for (index = 0; index < FLASH_BLOCK_NUM; index++) {
		if (fb[index].dirty)
			nvram_commit(index);

		ra_nvram_close(index);
	
		fb[index].valid = 0;
		//free env
		kfree(fb[index].env.data);
	}

#ifdef  CONFIG_DEVFS_FS
	devfs_unregister_chrdev(ralink_nvram_major, RALINK_NVRAM_DEVNAME);
	devfs_unregister(devfs_handle);
#else
	unregister_chrdev(ralink_nvram_major, RALINK_NVRAM_DEVNAME);
#endif

}
예제 #26
0
static void
dev_nvram_exit(void)
{
	int order = 0;
	struct page *page, *end;

	if (nvram_handle)
		devfs_unregister(nvram_handle);

	if (nvram_major >= 0)
		devfs_unregister_chrdev(nvram_major, "nvram");

	if (nvram_mtd)
		put_mtd_device(nvram_mtd);

	while ((PAGE_SIZE << order) < NVRAM_SPACE)
		order++;
	end = virt_to_page(nvram_buf + (PAGE_SIZE << order) - 1);
	for (page = virt_to_page(nvram_buf); page <= end; page++)
		mem_map_unreserve(page);

	_nvram_exit();
}
예제 #27
0
void cleanup_module(void)
{
	devfs_unregister_chrdev(DSP56K_MAJOR, "dsp56k");
	devfs_unregister (devfs_handle);
}
예제 #28
0
static int __init capi_init(void)
{
	char *p;
	char *compileinfo;

	MOD_INC_USE_COUNT;

	if ((p = strchr(revision, ':')) != 0 && p[1]) {
		strncpy(rev, p + 2, sizeof(rev));
		rev[sizeof(rev)-1] = 0;
		if ((p = strchr(rev, '$')) != 0 && p > rev)
		   *(p-1) = 0;
	} else
		strcpy(rev, "1.0");

	if (devfs_register_chrdev(capi_major, "capi20", &capi_fops)) {
		printk(KERN_ERR "capi20: unable to get major %d\n", capi_major);
		MOD_DEC_USE_COUNT;
		return -EIO;
	}

#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
	if (devfs_register_chrdev(capi_rawmajor, "capi/r%d", &capinc_raw_fops)) {
		devfs_unregister_chrdev(capi_major, "capi20");
		printk(KERN_ERR "capi20: unable to get major %d\n", capi_rawmajor);
		MOD_DEC_USE_COUNT;
		return -EIO;
	}
        devfs_register_series (NULL, "capi/r%u", CAPINC_NR_PORTS,
			      DEVFS_FL_DEFAULT,
                              capi_rawmajor, 0,
                              S_IFCHR | S_IRUSR | S_IWUSR,
                              &capinc_raw_fops, NULL);
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
	devfs_register (NULL, "isdn/capi20", DEVFS_FL_DEFAULT,
			capi_major, 0, S_IFCHR | S_IRUSR | S_IWUSR,
			&capi_fops, NULL);
	printk(KERN_NOTICE "capi20: started up with major %d\n", capi_major);

	if ((capifuncs = attach_capi_interface(&cuser)) == 0) {

		MOD_DEC_USE_COUNT;
		devfs_unregister_chrdev(capi_major, "capi20");
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
		devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
		devfs_unregister(devfs_find_handle(NULL, "capi20",
						   capi_major, 0,
						   DEVFS_SPECIAL_CHR, 0));
		return -EIO;
	}

#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
	if (capinc_tty_init() < 0) {
		(void) detach_capi_interface(&cuser);
		devfs_unregister_chrdev(capi_major, "capi20");
		devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
		MOD_DEC_USE_COUNT;
		return -ENOMEM;
	}
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */

	if (alloc_init() < 0) {
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
		unsigned int j;
		devfs_unregister_chrdev(capi_rawmajor, "capi/r%d");
		for (j = 0; j < CAPINC_NR_PORTS; j++) {
			char devname[32];
			sprintf(devname, "capi/r%u", j);
			devfs_unregister(devfs_find_handle(NULL, devname, capi_rawmajor, j, DEVFS_SPECIAL_CHR, 0));
		}
		capinc_tty_exit();
#endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */
		(void) detach_capi_interface(&cuser);
		devfs_unregister_chrdev(capi_major, "capi20");
		devfs_unregister(devfs_find_handle(NULL, "capi20",
						   capi_major, 0,
						   DEVFS_SPECIAL_CHR, 0));
		MOD_DEC_USE_COUNT;
		return -ENOMEM;
	}

	(void)proc_init();

#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
#if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE)
        compileinfo = " (middleware+capifs)";
#else
        compileinfo = " (no capifs)";
#endif
#else
        compileinfo = " (no middleware)";
#endif
	printk(KERN_NOTICE "capi20: Rev %s: started up with major %d%s\n",
				rev, capi_major, compileinfo);

	MOD_DEC_USE_COUNT;
	return 0;
}
예제 #29
0
int __init i2c_dev_init(void)
{
	int res;

	printk(KERN_INFO "i2c-dev.o: i2c /dev entries driver module version %s (%s)\n", I2C_VERSION, I2C_DATE);

	i2cdev_initialized = 0;
#ifdef CONFIG_DEVFS_FS
	if (devfs_register_chrdev(I2C_MAJOR, "i2c", &i2cdev_fops)) {
#else
	if (register_chrdev(I2C_MAJOR,"i2c",&i2cdev_fops)) {
#endif
		printk(KERN_ERR "i2c-dev.o: unable to get major %d for i2c bus\n",
		       I2C_MAJOR);
		return -EIO;
	}
#ifdef CONFIG_DEVFS_FS
	devfs_handle = devfs_mk_dir(NULL, "i2c", NULL);
#endif
	i2cdev_initialized ++;

	if ((res = i2c_add_driver(&i2cdev_driver))) {
		printk(KERN_ERR "i2c-dev.o: Driver registration failed, module not inserted.\n");
		i2cdev_cleanup();
		return res;
	}
	i2cdev_initialized ++;
	return 0;
}

int i2cdev_cleanup(void)
{
	int res;

	if (i2cdev_initialized >= 2) {
		if ((res = i2c_del_driver(&i2cdev_driver))) {
			printk("i2c-dev.o: Driver deregistration failed, "
			       "module not removed.\n");
			return res;
		}
	i2cdev_initialized --;
	}

	if (i2cdev_initialized >= 1) {
#ifdef CONFIG_DEVFS_FS
		devfs_unregister(devfs_handle);
		if ((res = devfs_unregister_chrdev(I2C_MAJOR, "i2c"))) {
#else
		if ((res = unregister_chrdev(I2C_MAJOR,"i2c"))) {
#endif
			printk("i2c-dev.o: unable to release major %d for i2c bus\n",
			       I2C_MAJOR);
			return res;
		}
		i2cdev_initialized --;
	}
	return 0;
}

EXPORT_NO_SYMBOLS;

#ifdef MODULE

MODULE_AUTHOR("Frodo Looijaard <*****@*****.**> and Simon G. Vogl <*****@*****.**>");
MODULE_DESCRIPTION("I2C /dev entries driver");
MODULE_LICENSE("GPL");

int init_module(void)
{
	return i2c_dev_init();
}

int cleanup_module(void)
{
	return i2cdev_cleanup();
}
예제 #30
0
static void __exit as3514_exit(void)
{
	devfs_unregister_chrdev(MISC_MAJOR, "rtc");
	devfs_unregister(rtc_devfs_handle);
}