static int __devinit avma1cs_config(struct pcmcia_device *link) { int i = -1; char devname[128]; IsdnCard_t icard; int busy = 0; dev_dbg(&link->dev, "avma1cs_config(0x%p)\n", link); devname[0] = 0; if (link->prod_id[1]) strlcpy(devname, link->prod_id[1], sizeof(devname)); if (pcmcia_loop_config(link, avma1cs_configcheck, NULL)) return -ENODEV; do { /* * allocate an interrupt line */ if (!link->irq) { /* undo */ pcmcia_disable_device(link); break; } /* * configure the PCMCIA socket */ i = pcmcia_enable_device(link); if (i != 0) { pcmcia_disable_device(link); break; } } while (0); /* If any step failed, release any partially configured state */ if (i != 0) { avma1cs_release(link); return -ENODEV; } icard.para[0] = link->irq; icard.para[1] = link->resource[0]->start; icard.protocol = isdnprot; icard.typ = ISDN_CTYPE_A1_PCMCIA; i = hisax_init_pcmcia(link, &busy, &icard); if (i < 0) { printk(KERN_ERR "avma1_cs: failed to initialize AVM A1 " "PCMCIA %d at i/o %#x\n", i, (unsigned int) link->resource[0]->start); avma1cs_release(link); return -ENODEV; } link->priv = (void *) (unsigned long) i; return 0; } /* avma1cs_config */
static int ft1000_config(struct pcmcia_device *link) { int ret; dev_dbg(&link->dev, "ft1000_cs: ft1000_config(0x%p)\n", link); /* setup IO window */ ret = pcmcia_loop_config(link, ft1000_confcheck, NULL); if (ret) { printk(KERN_INFO "ft1000: Could not configure pcmcia\n"); return -ENODEV; } /* configure device */ ret = pcmcia_enable_device(link); if (ret) { printk(KERN_INFO "ft1000: could not enable pcmcia\n"); goto failed; } link->priv = init_ft1000_card(link, &ft1000_reset); if (!link->priv) { printk(KERN_INFO "ft1000: Could not register as network device\n"); goto failed; } /* Finally, report what we've done */ return 0; failed: pcmcia_disable_device(link); return -ENODEV; }
static void ixj_cs_release(struct pcmcia_device *link) { ixj_info_t *info = link->priv; dev_dbg(&link->dev, "ixj_cs_release\n"); info->ndev = 0; pcmcia_disable_device(link); }
static int pdacf_config(struct pcmcia_device *link) { struct snd_pdacf *pdacf = link->priv; int ret; snd_printdd(KERN_DEBUG "pdacf_config called\n"); link->conf.ConfigIndex = 0x5; ret = pcmcia_request_io(link); if (ret) goto failed; ret = pcmcia_request_exclusive_irq(link, pdacf_interrupt); if (ret) goto failed; ret = pcmcia_request_configuration(link, &link->conf); if (ret) goto failed; if (snd_pdacf_assign_resources(pdacf, link->resource[0]->start, link->irq) < 0) goto failed; return 0; failed: pcmcia_disable_device(link); return -ENODEV; }
static void sl811_cs_release(struct pcmcia_device * link) { dev_dbg(&link->dev, "sl811_cs_release\n"); pcmcia_disable_device(link); platform_device_unregister(&platform_dev); }
static void sl811_cs_release(struct pcmcia_device * link) { DBG(0, "sl811_cs_release(0x%p)\n", link); pcmcia_disable_device(link); platform_device_unregister(&platform_dev); }
static void dtl1_detach(struct pcmcia_device *link) { dtl1_info_t *info = link->priv; dtl1_close(info); pcmcia_disable_device(link); }
static void ixj_cs_release(struct pcmcia_device *link) { ixj_info_t *info = link->priv; DEBUG(0, "ixj_cs_release(0x%p)\n", link); info->ndev = 0; pcmcia_disable_device(link); }
static void aha152x_release_cs(struct pcmcia_device *link) { scsi_info_t *info = link->priv; aha152x_release(info->host); pcmcia_disable_device(link); }
/** * comedi_pcmcia_disable() - Disable the PCMCIA device and release the regions. * @dev: comedi_device struct */ void comedi_pcmcia_disable(struct comedi_device *dev) { struct pcmcia_device *link = comedi_to_pcmcia_dev(dev); if (link) pcmcia_disable_device(link); }
static int pdacf_config(struct pcmcia_device *link) { struct snd_pdacf *pdacf = link->priv; int ret; snd_printdd(KERN_DEBUG "pdacf_config called\n"); link->config_index = 0x5; link->config_flags |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ; ret = pcmcia_request_io(link); if (ret) goto failed; ret = pcmcia_request_irq(link, pdacf_interrupt); if (ret) goto failed; ret = pcmcia_enable_device(link); if (ret) goto failed; if (snd_pdacf_assign_resources(pdacf, link->resource[0]->start, link->irq) < 0) goto failed; return 0; failed: pcmcia_disable_device(link); return -ENODEV; }
static void btuart_release(struct pcmcia_device *link) { btuart_info_t *info = link->priv; btuart_close(info); pcmcia_disable_device(link); }
static void ines_gpib_release( struct pcmcia_device *link ) { DEBUG(0, "ines_gpib_release(0x%p)\n", link); /* Don't bother checking to see if these succeed or not */ pcmcia_release_window(link->win); pcmcia_disable_device (link); } /* gpib_release */
static void __devexit b43_pcmcia_remove(struct pcmcia_device *dev) { struct ssb_bus *ssb = dev->priv; ssb_bus_unregister(ssb); pcmcia_disable_device(dev); kfree(ssb); dev->priv = NULL; }
static __devexit void softingcs_remove(struct pcmcia_device *pcmcia) { struct platform_device *pdev = pcmcia->priv; /* free bits */ platform_device_unregister(pdev); /* release pcmcia stuff */ pcmcia_disable_device(pcmcia); }
//**************************************************************************** // is called at CARD_REMOVAL static void pccard_plugout(struct pcmcia_device *link) { PCAN_PCCARD *card = link->priv; DPRINTK(KERN_DEBUG "%s: pccard_plugout(0x%p)\n", DEVICE_NAME, link); pccard_release_all_devices(card); pcmcia_disable_device(link); }
static void fdomain_release(struct pcmcia_device *link) { scsi_info_t *info = link->priv; dev_dbg(&link->dev, "fdomain_release\n"); scsi_remove_host(info->host); pcmcia_disable_device(link); scsi_unregister(info->host); }
static void bluecard_release(struct pcmcia_device *link) { struct bluecard_info *info = link->priv; bluecard_close(info); del_timer_sync(&(info->timer)); pcmcia_disable_device(link); }
static void ft1000_detach(struct pcmcia_device *link) { struct net_device *dev = link->priv; if (dev) stop_ft1000_card(dev); pcmcia_disable_device(link); free_netdev(dev); }
static void avma1cs_release(struct pcmcia_device *link) { local_info_t *local = link->priv; DEBUG(0, "avma1cs_release(0x%p)\n", link); /* now unregister function with hisax */ HiSax_closecard(local->node.minor); pcmcia_disable_device(link); } /* avma1cs_release */
static void avma1cs_release(struct pcmcia_device *link) { unsigned long minor = (unsigned long) link->priv; dev_dbg(&link->dev, "avma1cs_release(0x%p)\n", link); /* now unregister function with hisax */ HiSax_closecard(minor); pcmcia_disable_device(link); } /* avma1cs_release */
static void prism2_cs_remove(struct pcmcia_device *pdev) { struct wlandevice *wlandev; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) dev_link_t *link = dev_to_instance(pdev); #endif DBFENTER; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) wlandev = pdev->priv; #else wlandev = link->priv; #endif if (wlandev) { p80211netdev_hwremoved(wlandev); unregister_wlandev(wlandev); wlan_unsetup(wlandev); if (wlandev->priv) { hfa384x_t *hw = wlandev->priv; wlandev->priv = NULL; if (hw) { hfa384x_destroy(hw); kfree(hw); } } kfree(wlandev); } #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16) pdev->priv = NULL; pcmcia_disable_device(pdev); #else if (link->state & DEV_CONFIG) { if (link->win) pcmcia_release_window(link->win); pcmcia_release_configuration(link->handle); if (link->io.NumPorts1) pcmcia_release_io(link->handle, &link->io); if (link->irq.AssignedIRQ) pcmcia_release_irq(link->handle, &link->irq); link->state &= ~DEV_CONFIG; } link->priv = NULL; kfree(link); #endif DBFEXIT; return; }
static void atmel_release(struct pcmcia_device *link) { struct net_device *dev = ((local_info_t*)link->priv)->eth_dev; dev_dbg(&link->dev, "atmel_release\n"); if (dev) stop_atmel_card(dev); ((local_info_t*)link->priv)->eth_dev = NULL; pcmcia_disable_device(link); }
static void atmel_release(struct pcmcia_device *link) { struct net_device *dev = ((local_info_t*)link->priv)->eth_dev; DEBUG(0, "atmel_release(0x%p)\n", link); if (dev) stop_atmel_card(dev); ((local_info_t*)link->priv)->eth_dev = NULL; pcmcia_disable_device(link); }
void wl_adapter_release(struct pcmcia_device *link) { DBG_FUNC("wl_adapter_release"); DBG_ENTER(DbgInfo); DBG_PARAM(DbgInfo, "link", "0x%p", link); /* Stop hardware */ wl_remove(link->priv); pcmcia_disable_device(link); DBG_LEAVE(DbgInfo); } /* wl_adapter_release */
static void qlogic_release(struct pcmcia_device *link) { scsi_info_t *info = link->priv; dev_dbg(&link->dev, "qlogic_release\n"); scsi_remove_host(info->host); free_irq(link->irq, info->host); pcmcia_disable_device(link); scsi_host_put(info->host); }
static void release_ipwireless(struct ipw_dev *ipw) { pcmcia_disable_device(ipw->link); if (ipw->common_memory) { release_mem_region(ipw->request_common_memory.Base, ipw->request_common_memory.Size); iounmap(ipw->common_memory); } if (ipw->attr_memory) { release_mem_region(ipw->request_attr_memory.Base, ipw->request_attr_memory.Size); iounmap(ipw->attr_memory); } if (ipw->common_memory) pcmcia_release_window(ipw->handle_common_memory); if (ipw->attr_memory) pcmcia_release_window(ipw->handle_attr_memory); /* Break the link with Card Services */ pcmcia_disable_device(ipw->link); }
static void qlogic_release(struct pcmcia_device *link) { scsi_info_t *info = link->priv; DEBUG(0, "qlogic_release(0x%p)\n", link); scsi_remove_host(info->host); free_irq(link->irq.AssignedIRQ, info->host); pcmcia_disable_device(link); scsi_host_put(info->host); }
static int qlogic_config(struct pcmcia_device * link) { scsi_info_t *info = link->priv; int last_ret, last_fn; struct Scsi_Host *host; DEBUG(0, "qlogic_config(0x%p)\n", link); last_ret = pcmcia_loop_config(link, qlogic_config_check, NULL); if (last_ret) { cs_error(link, RequestIO, last_ret); goto failed; } CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); if ((info->manf_id == MANFID_MACNICA) || (info->manf_id == MANFID_PIONEER) || (info->manf_id == 0x0098)) { /* set ATAcmd */ outb(0xb4, link->io.BasePort1 + 0xd); outb(0x24, link->io.BasePort1 + 0x9); outb(0x04, link->io.BasePort1 + 0xd); } /* The KXL-810AN has a bigger IO port window */ if (link->io.NumPorts1 == 32) host = qlogic_detect(&qlogicfas_driver_template, link, link->io.BasePort1 + 16, link->irq.AssignedIRQ); else host = qlogic_detect(&qlogicfas_driver_template, link, link->io.BasePort1, link->irq.AssignedIRQ); if (!host) { printk(KERN_INFO "%s: no SCSI devices found\n", qlogic_name); goto cs_failed; } sprintf(info->node.dev_name, "scsi%d", host->host_no); link->dev_node = &info->node; info->host = host; return 0; cs_failed: cs_error(link, last_fn, last_ret); pcmcia_disable_device(link); failed: return -ENODEV; } /* qlogic_config */
static void parport_cs_release(struct pcmcia_device *link) { parport_info_t *info = link->priv; dev_dbg(&link->dev, "parport_release\n"); if (info->ndev) { struct parport *p = info->port; parport_pc_unregister_port(p); } info->ndev = 0; pcmcia_disable_device(link); } /* parport_cs_release */