Exit function
Prev | Chapter 4. Basic board driver | Next

## Exit function

The exit function is only neccecary if the driver is compiled as a module. It releases all resources which are held by the chip driver and unregisters the partitions in the MTD layer.

    #ifdef MODULE
    static void __exit board_cleanup (void)
    {
    	/* Release resources, unregister device */
    	nand_release (board_mtd);

    	/* unmap physical address */
    	iounmap((void *)baseaddr);

    	/* Free the MTD device structure */
    	kfree (board_mtd);
    }
    module_exit(board_cleanup);
    #endif

Prev | Up | Next
Init function | Home | Chapter 5. Advanced board driver functions