Пример #1
0
/* Limpieza - liberamos el fichero correspondiente desde /proc */
void cleanup_module()
{
  int ret;

  /* liberamos el dispositivo */
  ret = module_unregister_chrdev(Major, DEVICE_NAME);
 
  /* Si hay un error, lo indicamos */ 
  if (ret < 0)
    printk("Error en unregister_chrdev: %d\n", ret);
}  
Пример #2
0
void
cleanup_module (void)
{
  int             i;

  if (MOD_IN_USE)
    {
      return;
    }

  if (chrdev_registered)
    module_unregister_chrdev (sound_major, "sound");

#ifdef CONFIG_SEQUENCER
  sound_stop_timer ();
#endif

#ifdef CONFIG_LOWLEVEL_SOUND
  {
    extern void     sound_unload_lowlevel_drivers (void);

    sound_unload_lowlevel_drivers ();
  }
#endif
  sound_unload_drivers ();

  for (i = 0; i < sound_nblocks; i++)
    vfree (sound_mem_blocks[i]);

  free_all_irqs ();		/* If something was left allocated by accident */

  for (i = 0; i < 8; i++)
    if (dma_alloc_map[i] != DMA_MAP_UNAVAIL)
      {
	printk ("Sound: Hmm, DMA%d was left allocated - fixed\n", i);
	sound_free_dma (i);
      }


}