void __exit ns558_exit(void) { struct ns558 *next, *port = ns558; while (port) { gameport_unregister_port(&port->gameport); switch (port->type) { #ifdef NSS558_ISAPNP case NS558_PNP: if (port->dev->deactivate) port->dev->deactivate(port->dev); /* fall through */ #endif case NS558_ISA: release_region(port->gameport.io, port->size); break; default: break; } next = port->next; kfree(port); port = next; } }
static void __devexit emu_remove(struct pci_dev *pdev) { struct emu *emu = pci_get_drvdata(pdev); gameport_unregister_port(&emu->gameport); release_region(emu->gameport.io, emu->size); kfree(emu); }
void snd_ymfpci_free_gameport(struct snd_ymfpci *chip) { if (chip->gameport) { struct resource *r = gameport_get_port_data(chip->gameport); gameport_unregister_port(chip->gameport); chip->gameport = NULL; release_and_free_resource(r); } }
static void __exit cleanup_mad16(void) { if (found_mpu) unload_mad16_mpu(&cfg_mpu); if (gameport.io) { /* the gameport was initialized so we must free it up */ gameport_unregister_port(&gameport); gameport.io = 0; release_region(0x201, 1); } unload_mad16(&cfg); }
static int snd_cmi8328_remove(struct device *pdev, unsigned int dev) { struct snd_card *card = dev_get_drvdata(pdev); struct snd_cmi8328 *cmi = card->private_data; #ifdef SUPPORT_JOYSTICK if (cmi->gameport) { struct resource *res = gameport_get_port_data(cmi->gameport); gameport_unregister_port(cmi->gameport); release_and_free_resource(res); } #endif /* disable everything */ snd_cmi8328_cfg_write(cmi->port, CFG1, CFG1_SB_DISABLE); snd_cmi8328_cfg_write(cmi->port, CFG2, 0); snd_cmi8328_cfg_write(cmi->port, CFG3, 0); snd_card_free(card); return 0; }