/* * 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(); }
/* * 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); }
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 }
/* * 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); }
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(); }