示例#1
0
文件: main.c 项目: accesine/osrusbfx2
/*
 * The cleanup function is used to handle initialization failures as well.
 * Thefore, it must be careful to work correctly even if some of the items
 * have not been initialized
 */
void scull_cleanup_module(void)
{
	int i;
	dev_t devno = MKDEV(scull_major, scull_minor);

	/* Get rid of our char dev entries */
	if (scull_devices) {
		for (i = 0; i < scull_nr_devs; i++) {
			scull_trim(scull_devices + i);
			cdev_del(&scull_devices[i].cdev);
		}
		kfree(scull_devices);
	}

#ifdef SCULL_DEBUG /* use proc only if debugging */
	scull_remove_proc();
#endif

	/* cleanup_module is never called if registering failed */
	unregister_chrdev_region(devno, scull_nr_devs);

	/* and call the cleanup functions for friend devices */
	scull_p_cleanup();
	scull_access_cleanup();

}
示例#2
0
/*
 * The cleanup function is used to handle initialization failures as well.
 * Thefore, it must be careful to work correctly even if some of the items
 * have not been initialized
 */
void scull_cleanup_module(void)
{
    int i;

#ifndef CONFIG_DEVFS_FS
    /* cleanup_module is never called if registering failed */
    unregister_chrdev(scull_major, "scull");
#endif

    scull_remove_proc();
    if (scull_devices) {
        for (i=0; i<scull_nr_devs; i++) {
            scull_trim(scull_devices+i);
            /* the following line is only used for devfs */
            devfs_unregister(scull_devices[i].handle);
        }
        kfree(scull_devices);
    }

    /* and call the cleanup functions for friend devices */
    scull_p_cleanup();
    scull_access_cleanup();

    /* once again, only for devfs */
    devfs_unregister(scull_devfs_dir);

}
示例#3
0
void  scull_cleanup_module( void )
{
	dev_t devno;

	devno = MKDEV( scull_major, scull_mino );

	unregister_chrdev_region( devno, 1 );
#ifdef SCULL_DEBUG
	scull_remove_proc();
#endif
}
示例#4
0
/*
 * The cleanup function is used to handle initialization failures as well.
 * Thefore, it must be careful to work correctly even if some of the items
 * have not been initialized
 */
void scull_cleanup_module(void)
{
	int i;
	dev_t devno = MKDEV(scull_major, scull_minor);


	/* Get rid of our char dev entries */
	if (scull_devices) {
		for (i = 0; i < scull_nr_devs; i++) {
			scull_trim(scull_devices + i);
			cdev_del(&scull_devices[i].cdev);
		}
		kfree(scull_devices);
	}

#ifdef SCULL_DEBUG
	scull_remove_proc();
#endif
	/* cleanup_module is never called if registering failed */
	unregister_chrdev_region(devno, scull_nr_devs);


}
示例#5
0
void scull_cleanup_module(void)
{
	int i;
	dev_t devno = MKDEV(scull_major, scull_minor);

	
	if (scull_devices) {
		for (i = 0; i < scull_nr_devs; i++) {
			scull_trim(scull_devices + i);//???
			cdev_del(&scull_devices[i].cdev);
		}
		kfree(scull_devices);
	}

//#ifdef SCULL_DEBUG 
	scull_remove_proc();
//#endif

	unregister_chrdev_region(devno, scull_nr_devs);

//	scull_p_cleanup();
//	scull_access_cleanup();

}