From eb14120f743d29744d9475bffec56ff4ad43a749 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sun, 7 Mar 2010 12:21:16 +0100 Subject: pcmcia: re-work pcmcia_request_irq() Instead of the old pcmcia_request_irq() interface, drivers may now choose between: - calling request_irq/free_irq directly. Use the IRQ from *p_dev->irq. - use pcmcia_request_irq(p_dev, handler_t); the PCMCIA core will clean up automatically on calls to pcmcia_disable_device() or device ejection. - drivers still not capable of IRQF_SHARED (or not telling us so) may use the deprecated pcmcia_request_exclusive_irq() for the time being; they might receive a shared IRQ nonetheless. CC: linux-bluetooth@vger.kernel.org CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-serial@vger.kernel.org CC: alsa-devel@alsa-project.org CC: linux-usb@vger.kernel.org CC: linux-ide@vger.kernel.org Signed-off-by: Dominik Brodowski --- drivers/net/pcmcia/3c574_cs.c | 6 ++---- drivers/net/pcmcia/3c589_cs.c | 7 +++---- drivers/net/pcmcia/axnet_cs.c | 13 ++++--------- drivers/net/pcmcia/com20020_cs.c | 8 +++----- drivers/net/pcmcia/fmvj18x_cs.c | 10 ++-------- drivers/net/pcmcia/ibmtr_cs.c | 8 +++----- drivers/net/pcmcia/nmclan_cs.c | 6 ++---- drivers/net/pcmcia/pcnet_cs.c | 8 ++------ drivers/net/pcmcia/smc91c92_cs.c | 8 ++------ drivers/net/pcmcia/xirc2ps_cs.c | 7 ++----- drivers/net/wireless/airo_cs.c | 25 +++++-------------------- drivers/net/wireless/atmel_cs.c | 28 +++++----------------------- drivers/net/wireless/b43/pcmcia.c | 5 +---- drivers/net/wireless/hostap/hostap_cs.c | 29 ++++++----------------------- drivers/net/wireless/libertas/if_cs.c | 21 ++++++--------------- drivers/net/wireless/orinoco/orinoco_cs.c | 13 ++----------- drivers/net/wireless/orinoco/spectrum_cs.c | 13 ++----------- drivers/net/wireless/ray_cs.c | 8 ++------ drivers/net/wireless/wl3501_cs.c | 8 ++------ 19 files changed, 56 insertions(+), 175 deletions(-) (limited to 'drivers/net') diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index 757f87bb1db..14428317c00 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c @@ -283,8 +283,6 @@ static int tc574_probe(struct pcmcia_device *link) spin_lock_init(&lp->window_lock); link->io.NumPorts1 = 32; link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; - link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; - link->irq.Handler = &el3_interrupt; link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.IntType = INT_MEMORY_AND_IO; link->conf.ConfigIndex = 1; @@ -353,7 +351,7 @@ static int tc574_config(struct pcmcia_device *link) if (i != 0) goto failed; - ret = pcmcia_request_irq(link, &link->irq); + ret = pcmcia_request_irq(link, el3_interrupt); if (ret) goto failed; @@ -361,7 +359,7 @@ static int tc574_config(struct pcmcia_device *link) if (ret) goto failed; - dev->irq = link->irq.AssignedIRQ; + dev->irq = link->irq; dev->base_addr = link->io.BasePort1; ioaddr = dev->base_addr; diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index 091e0b00043..405d772bfde 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c @@ -194,8 +194,7 @@ static int tc589_probe(struct pcmcia_device *link) spin_lock_init(&lp->lock); link->io.NumPorts1 = 16; link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; - link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; - link->irq.Handler = &el3_interrupt; + link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.IntType = INT_MEMORY_AND_IO; link->conf.ConfigIndex = 1; @@ -271,7 +270,7 @@ static int tc589_config(struct pcmcia_device *link) if (i != 0) goto failed; - ret = pcmcia_request_irq(link, &link->irq); + ret = pcmcia_request_irq(link, el3_interrupt); if (ret) goto failed; @@ -279,7 +278,7 @@ static int tc589_config(struct pcmcia_device *link) if (ret) goto failed; - dev->irq = link->irq.AssignedIRQ; + dev->irq = link->irq; dev->base_addr = link->io.BasePort1; ioaddr = dev->base_addr; EL3WINDOW(0); diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 9f3d593f14e..967547a84b4 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c @@ -168,7 +168,6 @@ static int axnet_probe(struct pcmcia_device *link) info = PRIV(dev); info->p_dev = link; link->priv = dev; - link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.IntType = INT_MEMORY_AND_IO; @@ -265,12 +264,9 @@ static int try_io_port(struct pcmcia_device *link) int j, ret; if (link->io.NumPorts1 == 32) { link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; - if (link->io.NumPorts2 > 0) { - /* for master/slave multifunction cards */ + /* for master/slave multifunction cards */ + if (link->io.NumPorts2 > 0) link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; - link->irq.Attributes = - IRQ_TYPE_DYNAMIC_SHARING; - } } else { /* This should be two 16-port windows */ link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; @@ -336,8 +332,7 @@ static int axnet_config(struct pcmcia_device *link) if (ret != 0) goto failed; - ret = pcmcia_request_irq(link, &link->irq); - if (ret) + if (!link->irq) goto failed; if (link->io.NumPorts2 == 8) { @@ -349,7 +344,7 @@ static int axnet_config(struct pcmcia_device *link) if (ret) goto failed; - dev->irq = link->irq.AssignedIRQ; + dev->irq = link->irq; dev->base_addr = link->io.BasePort1; if (!get_prom(link)) { diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c index 21d9c9d815d..278438beb91 100644 --- a/drivers/net/pcmcia/com20020_cs.c +++ b/drivers/net/pcmcia/com20020_cs.c @@ -163,7 +163,6 @@ static int com20020_probe(struct pcmcia_device *p_dev) p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; p_dev->io.NumPorts1 = 16; p_dev->io.IOAddrLines = 16; - p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE; p_dev->conf.Attributes = CONF_ENABLE_IRQ; p_dev->conf.IntType = INT_MEMORY_AND_IO; @@ -275,15 +274,14 @@ static int com20020_config(struct pcmcia_device *link) dev_dbg(&link->dev, "got ioaddr %Xh\n", ioaddr); dev_dbg(&link->dev, "request IRQ %d\n", - link->irq.AssignedIRQ); - i = pcmcia_request_irq(link, &link->irq); - if (i != 0) + link->irq); + if (!link->irq) { dev_dbg(&link->dev, "requestIRQ failed totally!\n"); goto failed; } - dev->irq = link->irq.AssignedIRQ; + dev->irq = link->irq; ret = pcmcia_request_configuration(link, &link->conf); if (ret) diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index b9dc80b9d04..31f1a037737 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c @@ -254,10 +254,6 @@ static int fmvj18x_probe(struct pcmcia_device *link) link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; link->io.IOAddrLines = 5; - /* Interrupt setup */ - link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; - link->irq.Handler = fjn_interrupt; - /* General socket configuration */ link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.IntType = INT_MEMORY_AND_IO; @@ -425,8 +421,6 @@ static int fmvj18x_config(struct pcmcia_device *link) } if (link->io.NumPorts2 != 0) { - link->irq.Attributes = - IRQ_TYPE_DYNAMIC_SHARING; ret = mfc_try_io_port(link); if (ret != 0) goto failed; } else if (cardtype == UNGERMANN) { @@ -437,14 +431,14 @@ static int fmvj18x_config(struct pcmcia_device *link) if (ret) goto failed; } - ret = pcmcia_request_irq(link, &link->irq); + ret = pcmcia_request_irq(link, fjn_interrupt); if (ret) goto failed; ret = pcmcia_request_configuration(link, &link->conf); if (ret) goto failed; - dev->irq = link->irq.AssignedIRQ; + dev->irq = link->irq; dev->base_addr = link->io.BasePort1; if (link->io.BasePort2 != 0) { diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index 37f4a6fdc3e..0225cdffa4b 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c @@ -156,8 +156,6 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link) link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.NumPorts1 = 4; link->io.IOAddrLines = 16; - link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; - link->irq.Handler = ibmtr_interrupt; link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.IntType = INT_MEMORY_AND_IO; link->conf.Present = PRESENT_OPTION; @@ -238,11 +236,11 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) } dev->base_addr = link->io.BasePort1; - ret = pcmcia_request_irq(link, &link->irq); + ret = pcmcia_request_exclusive_irq(link, ibmtr_interrupt); if (ret) goto failed; - dev->irq = link->irq.AssignedIRQ; - ti->irq = link->irq.AssignedIRQ; + dev->irq = link->irq; + ti->irq = link->irq; ti->global_int_enable=GLOBAL_INT_ENABLE+((dev->irq==9) ? 2 : dev->irq); /* Allocate the MMIO memory window */ diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index c717b143f11..b779e3a0b4d 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c @@ -463,8 +463,6 @@ static int nmclan_probe(struct pcmcia_device *link) link->io.NumPorts1 = 32; link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; link->io.IOAddrLines = 5; - link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; - link->irq.Handler = mace_interrupt; link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.IntType = INT_MEMORY_AND_IO; link->conf.ConfigIndex = 1; @@ -652,14 +650,14 @@ static int nmclan_config(struct pcmcia_device *link) ret = pcmcia_request_io(link, &link->io); if (ret) goto failed; - ret = pcmcia_request_irq(link, &link->irq); + ret = pcmcia_request_exclusive_irq(link, mace_interrupt); if (ret) goto failed; ret = pcmcia_request_configuration(link, &link->conf); if (ret) goto failed; - dev->irq = link->irq.AssignedIRQ; + dev->irq = link->irq; dev->base_addr = link->io.BasePort1; ioaddr = dev->base_addr; diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index 4c0368de181..af09be48757 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c @@ -264,7 +264,6 @@ static int pcnet_probe(struct pcmcia_device *link) info->p_dev = link; link->priv = dev; - link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.IntType = INT_MEMORY_AND_IO; @@ -488,8 +487,6 @@ static int try_io_port(struct pcmcia_device *link) if (link->io.NumPorts2 > 0) { /* for master/slave multifunction cards */ link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; - link->irq.Attributes = - IRQ_TYPE_DYNAMIC_SHARING; } } else { /* This should be two 16-port windows */ @@ -559,8 +556,7 @@ static int pcnet_config(struct pcmcia_device *link) if (ret) goto failed; - ret = pcmcia_request_irq(link, &link->irq); - if (ret) + if (!link->irq) goto failed; if (link->io.NumPorts2 == 8) { @@ -574,7 +570,7 @@ static int pcnet_config(struct pcmcia_device *link) ret = pcmcia_request_configuration(link, &link->conf); if (ret) goto failed; - dev->irq = link->irq.AssignedIRQ; + dev->irq = link->irq; dev->base_addr = link->io.BasePort1; if (info->flags & HAS_MISC_REG) { if ((if_port == 1) || (if_port == 2)) diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index ccc553782a0..ad061c7106b 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c @@ -329,8 +329,6 @@ static int smc91c92_probe(struct pcmcia_device *link) link->io.NumPorts1 = 16; link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; link->io.IOAddrLines = 4; - link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; - link->irq.Handler = &smc_interrupt; link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.IntType = INT_MEMORY_AND_IO; @@ -453,7 +451,6 @@ static int mhz_mfc_config(struct pcmcia_device *link) link->conf.Attributes |= CONF_ENABLE_SPKR; link->conf.Status = CCSR_AUDIO_ENA; - link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; link->io.IOAddrLines = 16; link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; link->io.NumPorts2 = 8; @@ -652,7 +649,6 @@ static int osi_config(struct pcmcia_device *link) link->conf.Attributes |= CONF_ENABLE_SPKR; link->conf.Status = CCSR_AUDIO_ENA; - link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; link->io.NumPorts1 = 64; link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; link->io.NumPorts2 = 8; @@ -877,7 +873,7 @@ static int smc91c92_config(struct pcmcia_device *link) if (i) goto config_failed; - i = pcmcia_request_irq(link, &link->irq); + i = pcmcia_request_irq(link, smc_interrupt); if (i) goto config_failed; i = pcmcia_request_configuration(link, &link->conf); @@ -887,7 +883,7 @@ static int smc91c92_config(struct pcmcia_device *link) if (smc->manfid == MANFID_MOTOROLA) mot_config(link); - dev->irq = link->irq.AssignedIRQ; + dev->irq = link->irq; if ((if_port >= 0) && (if_port <= 2)) dev->if_port = if_port; diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index 4d1802e457b..c9e7d7d4783 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c @@ -555,7 +555,6 @@ xirc2ps_probe(struct pcmcia_device *link) link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.IntType = INT_MEMORY_AND_IO; link->conf.ConfigIndex = 1; - link->irq.Handler = xirc2ps_interrupt; /* Fill in card specific entries */ dev->netdev_ops = &netdev_ops; @@ -841,7 +840,6 @@ xirc2ps_config(struct pcmcia_device * link) link->conf.Attributes |= CONF_ENABLE_SPKR; link->conf.Status |= CCSR_AUDIO_ENA; } - link->irq.Attributes |= IRQ_TYPE_DYNAMIC_SHARING; link->io.NumPorts2 = 8; link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; if (local->dingo) { @@ -866,7 +864,6 @@ xirc2ps_config(struct pcmcia_device * link) } printk(KNOT_XIRC "no ports available\n"); } else { - link->irq.Attributes |= IRQ_TYPE_DYNAMIC_SHARING; link->io.NumPorts1 = 16; for (ioaddr = 0x300; ioaddr < 0x400; ioaddr += 0x10) { link->io.BasePort1 = ioaddr; @@ -885,7 +882,7 @@ xirc2ps_config(struct pcmcia_device * link) * Now allocate an interrupt line. Note that this does not * actually assign a handler to the interrupt. */ - if ((err=pcmcia_request_irq(link, &link->irq))) + if ((err=pcmcia_request_irq(link, xirc2ps_interrupt))) goto config_error; /**************** @@ -982,7 +979,7 @@ xirc2ps_config(struct pcmcia_device * link) printk(KNOT_XIRC "invalid if_port requested\n"); /* we can now register the device with the net subsystem */ - dev->irq = link->irq.AssignedIRQ; + dev->irq = link->irq; dev->base_addr = link->io.BasePort1; if (local->dingo) diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c index f6036fb4231..7867c51be15 100644 --- a/drivers/net/wireless/airo_cs.c +++ b/drivers/net/wireless/airo_cs.c @@ -132,10 +132,6 @@ static int airo_probe(struct pcmcia_device *p_dev) dev_dbg(&p_dev->dev, "airo_attach()\n"); - /* Interrupt setup */ - p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; - p_dev->irq.Handler = NULL; - /* General socket configuration defaults can go here. In this client, we assume very little, and rely on the CIS for almost @@ -212,9 +208,7 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev, else if (dflt->vpp1.present & (1<conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000; - /* Do we need to allocate an interrupt? */ - if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1) - p_dev->conf.Attributes |= CONF_ENABLE_IRQ; + p_dev->conf.Attributes |= CONF_ENABLE_IRQ; /* IO window settings */ p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; @@ -300,16 +294,8 @@ static int airo_config(struct pcmcia_device *link) if (ret) goto failed; - /* - Allocate an interrupt line. Note that this does not assign a - handler to the interrupt, unless the 'Handler' member of the - irq structure is initialized. - */ - if (link->conf.Attributes & CONF_ENABLE_IRQ) { - ret = pcmcia_request_irq(link, &link->irq); - if (ret) - goto failed; - } + if (!link->irq) + goto failed; /* This actually configures the PCMCIA socket -- setting up @@ -320,7 +306,7 @@ static int airo_config(struct pcmcia_device *link) if (ret) goto failed; ((local_info_t *)link->priv)->eth_dev = - init_airo_card(link->irq.AssignedIRQ, + init_airo_card(link->irq, link->io.BasePort1, 1, &link->dev); if (!((local_info_t *)link->priv)->eth_dev) goto failed; @@ -338,8 +324,7 @@ static int airo_config(struct pcmcia_device *link) dev->node.dev_name, link->conf.ConfigIndex); if (link->conf.Vpp) printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); - if (link->conf.Attributes & CONF_ENABLE_IRQ) - printk(", irq %d", link->irq.AssignedIRQ); + printk(", irq %d", link->irq); if (link->io.NumPorts1) printk(", io 0x%04x-0x%04x", link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1-1); diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c index 32407911842..759cdc41932 100644 --- a/drivers/net/wireless/atmel_cs.c +++ b/drivers/net/wireless/atmel_cs.c @@ -141,10 +141,6 @@ static int atmel_probe(struct pcmcia_device *p_dev) dev_dbg(&p_dev->dev, "atmel_attach()\n"); - /* Interrupt setup */ - p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; - p_dev->irq.Handler = NULL; - /* General socket configuration defaults can go here. In this client, we assume very little, and rely on the CIS for almost @@ -226,9 +222,7 @@ static int atmel_config_check(struct pcmcia_device *p_dev, else if (dflt->vpp1.present & (1<conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000; - /* Do we need to allocate an interrupt? */ - if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1) - p_dev->conf.Attributes |= CONF_ENABLE_IRQ; + p_dev->conf.Attributes |= CONF_ENABLE_IRQ; /* IO window settings */ p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; @@ -278,15 +272,9 @@ static int atmel_config(struct pcmcia_device *link) if (pcmcia_loop_config(link, atmel_config_check, NULL)) goto failed; - /* - Allocate an interrupt line. Note that this does not assign a - handler to the interrupt, unless the 'Handler' member of the - irq structure is initialized. - */ - if (link->conf.Attributes & CONF_ENABLE_IRQ) { - ret = pcmcia_request_irq(link, &link->irq); - if (ret) - goto failed; + if (!link->irq) { + dev_err(&link->dev, "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config."); + goto failed; } /* @@ -298,14 +286,8 @@ static int atmel_config(struct pcmcia_device *link) if (ret) goto failed; - if (link->irq.AssignedIRQ == 0) { - printk(KERN_ALERT - "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config."); - goto failed; - } - ((local_info_t*)link->priv)->eth_dev = - init_atmel_card(link->irq.AssignedIRQ, + init_atmel_card(link->irq, link->io.BasePort1, did ? did->driver_info : ATMEL_FW_TYPE_NONE, &link->dev, diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c index 609e7051e01..0e99b634267 100644 --- a/drivers/net/wireless/b43/pcmcia.c +++ b/drivers/net/wireless/b43/pcmcia.c @@ -98,10 +98,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev) if (res != 0) goto err_disable; - dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; - dev->irq.Handler = NULL; /* The handler is registered later. */ - res = pcmcia_request_irq(dev, &dev->irq); - if (res != 0) + if (!dev->irq) goto err_disable; res = pcmcia_request_configuration(dev, &dev->conf); diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index a36501dbbe0..5e2efbb0367 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c @@ -556,15 +556,7 @@ static int prism2_config_check(struct pcmcia_device *p_dev, p_dev->conf.Vpp = dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000; /* Do we need to allocate an interrupt? */ - if (cfg->irq.IRQInfo1 || dflt->irq.IRQInfo1) - p_dev->conf.Attributes |= CONF_ENABLE_IRQ; - else if (!(p_dev->conf.Attributes & CONF_ENABLE_IRQ)) { - /* At least Compaq WL200 does not have IRQInfo1 set, - * but it does not work without interrupts.. */ - printk(KERN_WARNING "Config has no IRQ info, but trying to " - "enable IRQ anyway..\n"); - p_dev->conf.Attributes |= CONF_ENABLE_IRQ; - } + p_dev->conf.Attributes |= CONF_ENABLE_IRQ; /* IO window settings */ PDEBUG(DEBUG_EXTRA, "IO window settings: cfg->io.nwin=%d " @@ -636,18 +628,9 @@ static int prism2_config(struct pcmcia_device *link) strcpy(hw_priv->node.dev_name, dev->name); link->dev_node = &hw_priv->node; - /* - * Allocate an interrupt line. Note that this does not assign a - * handler to the interrupt, unless the 'Handler' member of the - * irq structure is initialized. - */ - if (link->conf.Attributes & CONF_ENABLE_IRQ) { - link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; - link->irq.Handler = prism2_interrupt; - ret = pcmcia_request_irq(link, &link->irq); - if (ret) - goto failed; - } + ret = pcmcia_request_irq(link, prism2_interrupt); + if (ret) + goto failed; /* * This actually configures the PCMCIA socket -- setting up @@ -658,7 +641,7 @@ static int prism2_config(struct pcmcia_device *link) if (ret) goto failed; - dev->irq = link->irq.AssignedIRQ; + dev->irq = link->irq; dev->base_addr = link->io.BasePort1; /* Finally, report what we've done */ @@ -668,7 +651,7 @@ static int prism2_config(struct pcmcia_device *link) printk(", Vpp %d.%d", link->conf.Vpp / 10, link->conf.Vpp % 10); if (link->conf.Attributes & CONF_ENABLE_IRQ) - printk(", irq %d", link->irq.AssignedIRQ); + printk(", irq %d", link->irq); if (link->io.NumPorts1) printk(", io 0x%04x-0x%04x", link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1-1); diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index 6d55439a7b9..08e4e390800 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c @@ -777,7 +777,7 @@ static void if_cs_release(struct pcmcia_device *p_dev) lbs_deb_enter(LBS_DEB_CS); - free_irq(p_dev->irq.AssignedIRQ, card); + free_irq(p_dev->irq, card); pcmcia_disable_device(p_dev); if (card->iobase) ioport_unmap(card->iobase); @@ -807,8 +807,7 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev, p_dev->io.NumPorts1 = cfg->io.win[0].len; /* Do we need to allocate an interrupt? */ - if (cfg->irq.IRQInfo1) - p_dev->conf.Attributes |= CONF_ENABLE_IRQ; + p_dev->conf.Attributes |= CONF_ENABLE_IRQ; /* IO window settings */ if (cfg->io.nwin != 1) { @@ -837,9 +836,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev) card->p_dev = p_dev; p_dev->priv = card; - p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; - p_dev->irq.Handler = NULL; - p_dev->conf.Attributes = 0; p_dev->conf.IntType = INT_MEMORY_AND_IO; @@ -854,13 +850,8 @@ static int if_cs_probe(struct pcmcia_device *p_dev) * a handler to the interrupt, unless the 'Handler' member of * the irq structure is initialized. */ - if (p_dev->conf.Attributes & CONF_ENABLE_IRQ) { - ret = pcmcia_request_irq(p_dev, &p_dev->irq); - if (ret) { - lbs_pr_err("error in pcmcia_request_irq\n"); - goto out1; - } - } + if (!p_dev->irq) + goto out1; /* Initialize io access */ card->iobase = ioport_map(p_dev->io.BasePort1, p_dev->io.NumPorts1); @@ -883,7 +874,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev) /* Finally, report what we've done */ lbs_deb_cs("irq %d, io 0x%04x-0x%04x\n", - p_dev->irq.AssignedIRQ, p_dev->io.BasePort1, + p_dev->irq, p_dev->io.BasePort1, p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1); /* @@ -940,7 +931,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev) priv->fw_ready = 1; /* Now actually get the IRQ */ - ret = request_irq(p_dev->irq.AssignedIRQ, if_cs_interrupt, + ret = request_irq(p_dev->irq, if_cs_interrupt, IRQF_SHARED, DRV_NAME, card); if (ret) { lbs_pr_err("error in request_irq\n"); diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c index 1d4ada188ed..5d29b11fdbc 100644 --- a/drivers/net/wireless/orinoco/orinoco_cs.c +++ b/drivers/net/wireless/orinoco/orinoco_cs.c @@ -119,10 +119,6 @@ orinoco_cs_probe(struct pcmcia_device *link) card->p_dev = link; link->priv = priv; - /* Interrupt setup */ - link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; - link->irq.Handler = orinoco_interrupt; - /* General socket configuration defaults can go here. In this * client, we assume very little, and rely on the CIS for * almost everything. In most clients, many details (i.e., @@ -258,12 +254,7 @@ orinoco_cs_config(struct pcmcia_device *link) goto failed; } - /* - * Allocate an interrupt line. Note that this does not assign - * a handler to the interrupt, unless the 'Handler' member of - * the irq structure is initialized. - */ - ret = pcmcia_request_irq(link, &link->irq); + ret = pcmcia_request_irq(link, orinoco_interrupt); if (ret) goto failed; @@ -296,7 +287,7 @@ orinoco_cs_config(struct pcmcia_device *link) /* Register an interface with the stack */ if (orinoco_if_add(priv, link->io.BasePort1, - link->irq.AssignedIRQ) != 0) { + link->irq) != 0) { printk(KERN_ERR PFX "orinoco_if_add() failed\n"); goto failed; } diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c index 59bda240fdc..7a8e056cd62 100644 --- a/drivers/net/wireless/orinoco/spectrum_cs.c +++ b/drivers/net/wireless/orinoco/spectrum_cs.c @@ -193,10 +193,6 @@ spectrum_cs_probe(struct pcmcia_device *link) card->p_dev = link; link->priv = priv; - /* Interrupt setup */ - link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; - link->irq.Handler = orinoco_interrupt; - /* General socket configuration defaults can go here. In this * client, we assume very little, and rely on the CIS for * almost everything. In most clients, many details (i.e., @@ -332,12 +328,7 @@ spectrum_cs_config(struct pcmcia_device *link) goto failed; } - /* - * Allocate an interrupt line. Note that this does not assign - * a handler to the interrupt, unless the 'Handler' member of - * the irq structure is initialized. - */ - ret = pcmcia_request_irq(link, &link->irq); + ret = pcmcia_request_irq(link, orinoco_interrupt); if (ret) goto failed; @@ -374,7 +365,7 @@ spectrum_cs_config(struct pcmcia_device *link) /* Register an interface with the stack */ if (orinoco_if_add(priv, link->io.BasePort1, - link->irq.AssignedIRQ) != 0) { + link->irq) != 0) { printk(KERN_ERR PFX "orinoco_if_add() failed\n"); goto failed; } diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 11865ea2187..fe4642a49bf 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c @@ -321,10 +321,6 @@ static int ray_probe(struct pcmcia_device *p_dev) p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; p_dev->io.IOAddrLines = 5; - /* Interrupt setup. For PCMCIA, driver takes what's given */ - p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; - p_dev->irq.Handler = &ray_interrupt; - /* General socket configuration */ p_dev->conf.Attributes = CONF_ENABLE_IRQ; p_dev->conf.IntType = INT_MEMORY_AND_IO; @@ -417,10 +413,10 @@ static int ray_config(struct pcmcia_device *link) /* Now allocate an interrupt line. Note that this does not actually assign a handler to the interrupt. */ - ret = pcmcia_request_irq(link, &link->irq); + ret = pcmcia_request_irq(link, ray_interrupt); if (ret) goto failed; - dev->irq = link->irq.AssignedIRQ; + dev->irq = link->irq; /* This actually configures the PCMCIA socket -- setting up the I/O windows and the interrupt mapping. diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index 7b9621de239..c43f05b98c4 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c @@ -1897,10 +1897,6 @@ static int wl3501_probe(struct pcmcia_device *p_dev) p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; p_dev->io.IOAddrLines = 5; - /* Interrupt setup */ - p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; - p_dev->irq.Handler = wl3501_interrupt; - /* General socket configuration */ p_dev->conf.Attributes = CONF_ENABLE_IRQ; p_dev->conf.IntType = INT_MEMORY_AND_IO; @@ -1961,7 +1957,7 @@ static int wl3501_config(struct pcmcia_device *link) /* Now allocate an interrupt line. Note that this does not actually * assign a handler to the interrupt. */ - ret = pcmcia_request_irq(link, &link->irq); + ret = pcmcia_request_irq(link, wl3501_interrupt); if (ret) goto failed; @@ -1972,7 +1968,7 @@ static int wl3501_config(struct pcmcia_device *link) if (ret) goto failed; - dev->irq = link->irq.AssignedIRQ; + dev->irq = link->irq; dev->base_addr = link->io.BasePort1; SET_NETDEV_DEV(dev, &link->dev); if (register_netdev(dev)) { -- cgit v1.2.3-70-g09d2 From 317b6d63000b3cc48c43d582d76063500e531a6c Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sat, 20 Mar 2010 19:26:51 +0100 Subject: pcmcia: dev_node removal (write-only drivers) dev_node_t was only used to transport some minor/major numbers from the PCMCIA device drivers to deprecated userspace helpers. However, only a few drivers made use of it, and the userspace helpers are deprecated anyways. Therefore, get rid of dev_node_t . As a first step, remove any usage of dev_node_t from drivers which only wrote to this typedef/struct, but did not make use of it. CC: linux-bluetooth@vger.kernel.org CC: Harald Welte CC: linux-mtd@lists.infradead.org CC: linux-wireless@vger.kernel.org CC: netdev@vger.kernel.org CC: linux-serial@vger.kernel.org CC: alsa-devel@alsa-project.org Signed-off-by: Dominik Brodowski --- drivers/bluetooth/bluecard_cs.c | 4 ---- drivers/bluetooth/bt3c_cs.c | 4 ---- drivers/bluetooth/btuart_cs.c | 4 ---- drivers/bluetooth/dtl1_cs.c | 4 ---- drivers/char/pcmcia/cm4040_cs.c | 5 ---- drivers/mtd/maps/pcmciamtd.c | 3 --- drivers/net/wireless/atmel_cs.c | 42 --------------------------------- drivers/net/wireless/hostap/hostap_cs.c | 9 ++----- drivers/parport/parport_cs.c | 5 ---- drivers/scsi/pcmcia/aha152x_stub.c | 3 --- drivers/scsi/pcmcia/fdomain_stub.c | 3 --- drivers/scsi/pcmcia/nsp_cs.c | 3 --- drivers/scsi/pcmcia/nsp_cs.h | 1 - drivers/scsi/pcmcia/qlogic_stub.c | 3 --- drivers/scsi/pcmcia/sym53c500_cs.c | 3 --- drivers/serial/serial_cs.c | 9 ------- drivers/telephony/ixj_pcmcia.c | 3 --- sound/pcmcia/pdaudiocf/pdaudiocf.c | 1 - sound/pcmcia/pdaudiocf/pdaudiocf.h | 1 - sound/pcmcia/vx/vxpocket.c | 2 -- sound/pcmcia/vx/vxpocket.h | 1 - 21 files changed, 2 insertions(+), 111 deletions(-) (limited to 'drivers/net') diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c index a34653db07b..6f907ebed2d 100644 --- a/drivers/bluetooth/bluecard_cs.c +++ b/drivers/bluetooth/bluecard_cs.c @@ -65,7 +65,6 @@ MODULE_LICENSE("GPL"); typedef struct bluecard_info_t { struct pcmcia_device *p_dev; - dev_node_t node; struct hci_dev *hdev; @@ -916,9 +915,6 @@ static int bluecard_config(struct pcmcia_device *link) if (bluecard_open(info) != 0) goto failed; - strcpy(info->node.dev_name, info->hdev->name); - link->dev_node = &info->node; - return 0; failed: diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c index 1ad9694d445..21e05fdc912 100644 --- a/drivers/bluetooth/bt3c_cs.c +++ b/drivers/bluetooth/bt3c_cs.c @@ -72,7 +72,6 @@ MODULE_FIRMWARE("BT3CPCC.bin"); typedef struct bt3c_info_t { struct pcmcia_device *p_dev; - dev_node_t node; struct hci_dev *hdev; @@ -751,9 +750,6 @@ found_port: if (bt3c_open(info) != 0) goto failed; - strcpy(info->node.dev_name, info->hdev->name); - link->dev_node = &info->node; - return 0; failed: diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index 1073d660d62..4ed7288f99d 100644 --- a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c @@ -67,7 +67,6 @@ MODULE_LICENSE("GPL"); typedef struct btuart_info_t { struct pcmcia_device *p_dev; - dev_node_t node; struct hci_dev *hdev; @@ -680,9 +679,6 @@ found_port: if (btuart_open(info) != 0) goto failed; - strcpy(info->node.dev_name, info->hdev->name); - link->dev_node = &info->node; - return 0; failed: diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c index 3d72afddabb..ef044d55cb2 100644 --- a/drivers/bluetooth/dtl1_cs.c +++ b/drivers/bluetooth/dtl1_cs.c @@ -67,7 +67,6 @@ MODULE_LICENSE("GPL"); typedef struct dtl1_info_t { struct pcmcia_device *p_dev; - dev_node_t node; struct hci_dev *hdev; @@ -629,9 +628,6 @@ static int dtl1_config(struct pcmcia_device *link) if (dtl1_open(info) != 0) goto failed; - strcpy(info->node.dev_name, info->hdev->name); - link->dev_node = &info->node; - return 0; failed: diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c index a6a70e476be..c0775c844e0 100644 --- a/drivers/char/pcmcia/cm4040_cs.c +++ b/drivers/char/pcmcia/cm4040_cs.c @@ -72,7 +72,6 @@ static struct class *cmx_class; struct reader_dev { struct pcmcia_device *p_dev; - dev_node_t node; wait_queue_head_t devq; wait_queue_head_t poll_wait; wait_queue_head_t read_wait; @@ -568,10 +567,6 @@ static int reader_config(struct pcmcia_device *link, int devno) } dev = link->priv; - sprintf(dev->node.dev_name, DEVICE_NAME "%d", devno); - dev->node.major = major; - dev->node.minor = devno; - dev->node.next = &dev->node; DEBUGP(2, dev, "device " DEVICE_NAME "%d at 0x%.4x-0x%.4x\n", devno, link->io.BasePort1, link->io.BasePort1+link->io.NumPorts1); diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c index 689d6a79ffc..87b2b8ff331 100644 --- a/drivers/mtd/maps/pcmciamtd.c +++ b/drivers/mtd/maps/pcmciamtd.c @@ -52,7 +52,6 @@ static const int debug = 0; struct pcmciamtd_dev { struct pcmcia_device *p_dev; - dev_node_t node; /* device node */ caddr_t win_base; /* ioremapped address of PCMCIA window */ unsigned int win_size; /* size of window */ unsigned int offset; /* offset into card the window currently points at */ @@ -647,9 +646,7 @@ static int pcmciamtd_config(struct pcmcia_device *link) pcmciamtd_release(link); return -ENODEV; } - snprintf(dev->node.dev_name, sizeof(dev->node.dev_name), "mtd%d", mtd->index); info("mtd%d: %s", mtd->index, mtd->name); - link->dev_node = &dev->node; return 0; failed: diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c index 759cdc41932..c2746fc7f2b 100644 --- a/drivers/net/wireless/atmel_cs.c +++ b/drivers/net/wireless/atmel_cs.c @@ -85,41 +85,7 @@ static void atmel_release(struct pcmcia_device *link); static void atmel_detach(struct pcmcia_device *p_dev); -/* - You'll also need to prototype all the functions that will actually - be used to talk to your device. See 'pcmem_cs' for a good example - of a fully self-sufficient driver; the other drivers rely more or - less on other parts of the kernel. -*/ - -/* - A linked list of "instances" of the atmelnet device. Each actual - PCMCIA card corresponds to one device instance, and is described - by one struct pcmcia_device structure (defined in ds.h). - - You may not want to use a linked list for this -- for example, the - memory card driver uses an array of struct pcmcia_device pointers, where minor - device numbers are used to derive the corresponding array index. -*/ - -/* - A driver needs to provide a dev_node_t structure for each device - on a card. In some cases, there is only one device per card (for - example, ethernet cards, modems). In other cases, there may be - many actual or logical devices (SCSI adapters, memory cards with - multiple partitions). The dev_node_t structures need to be kept - in a linked list starting at the 'dev' field of a struct pcmcia_device - structure. We allocate them in the card's private data structure, - because they generally shouldn't be allocated dynamically. - - In this case, we also provide a flag to indicate if a device is - "stopped" due to a power management event, or card ejection. The - device IO routines can use a flag like this to throttle IO to a - card that is not ready to accept it. -*/ - typedef struct local_info_t { - dev_node_t node; struct net_device *eth_dev; } local_info_t; @@ -297,14 +263,6 @@ static int atmel_config(struct pcmcia_device *link) goto failed; - /* - At this point, the dev_node_t structure(s) need to be - initialized and arranged in a linked list at link->dev_node. - */ - strcpy(dev->node.dev_name, ((local_info_t*)link->priv)->eth_dev->name ); - dev->node.major = dev->node.minor = 0; - link->dev_node = &dev->node; - return 0; failed: diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index 5e2efbb0367..db72461c486 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c @@ -39,7 +39,6 @@ MODULE_PARM_DESC(ignore_cis_vcc, "Ignore broken CIS VCC entry"); /* struct local_info::hw_priv */ struct hostap_cs_priv { - dev_node_t node; struct pcmcia_device *link; int sandisk_connectplus; }; @@ -625,8 +624,6 @@ static int prism2_config(struct pcmcia_device *link) local = iface->local; local->hw_priv = hw_priv; hw_priv->link = link; - strcpy(hw_priv->node.dev_name, dev->name); - link->dev_node = &hw_priv->node; ret = pcmcia_request_irq(link, prism2_interrupt); if (ret) @@ -665,11 +662,9 @@ static int prism2_config(struct pcmcia_device *link) sandisk_enable_wireless(dev); ret = prism2_hw_config(dev, 1); - if (!ret) { + if (!ret) ret = hostap_hw_ready(dev); - if (ret == 0 && local->ddev) - strcpy(hw_priv->node.dev_name, local->ddev->name); - } + return ret; failed: diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c index 80c9052bf3c..fd8cfe95f0a 100644 --- a/drivers/parport/parport_cs.c +++ b/drivers/parport/parport_cs.c @@ -75,7 +75,6 @@ INT_MODULE_PARM(epp_mode, 1); typedef struct parport_info_t { struct pcmcia_device *p_dev; int ndev; - dev_node_t node; struct parport *port; } parport_info_t; @@ -193,11 +192,7 @@ static int parport_config(struct pcmcia_device *link) if (epp_mode) p->modes |= PARPORT_MODE_TRISTATE | PARPORT_MODE_EPP; info->ndev = 1; - info->node.major = LP_MAJOR; - info->node.minor = p->number; info->port = p; - strcpy(info->node.dev_name, p->name); - link->dev_node = &info->node; return 0; diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c index c1de4ba1f0a..9d70aef9922 100644 --- a/drivers/scsi/pcmcia/aha152x_stub.c +++ b/drivers/scsi/pcmcia/aha152x_stub.c @@ -80,7 +80,6 @@ MODULE_LICENSE("Dual MPL/GPL"); typedef struct scsi_info_t { struct pcmcia_device *p_dev; - dev_node_t node; struct Scsi_Host *host; } scsi_info_t; @@ -185,8 +184,6 @@ static int aha152x_config_cs(struct pcmcia_device *link) goto failed; } - sprintf(info->node.dev_name, "scsi%d", host->host_no); - link->dev_node = &info->node; info->host = host; return 0; diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c index 8cb6d71f020..21b141151df 100644 --- a/drivers/scsi/pcmcia/fdomain_stub.c +++ b/drivers/scsi/pcmcia/fdomain_stub.c @@ -63,7 +63,6 @@ MODULE_LICENSE("Dual MPL/GPL"); typedef struct scsi_info_t { struct pcmcia_device *p_dev; - dev_node_t node; struct Scsi_Host *host; } scsi_info_t; @@ -155,8 +154,6 @@ static int fdomain_config(struct pcmcia_device *link) goto failed; scsi_scan_host(host); - sprintf(info->node.dev_name, "scsi%d", host->host_no); - link->dev_node = &info->node; info->host = host; return 0; diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index 24c78ed98f0..0f0e112c3f8 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c @@ -1754,8 +1754,6 @@ static int nsp_cs_config(struct pcmcia_device *link) scsi_scan_host(host); - snprintf(info->node.dev_name, sizeof(info->node.dev_name), "scsi%d", host->host_no); - link->dev_node = &info->node; info->host = host; /* Finally, report what we've done */ @@ -1813,7 +1811,6 @@ static void nsp_cs_release(struct pcmcia_device *link) if (info->host != NULL) { scsi_remove_host(info->host); } - link->dev_node = NULL; if (link->win) { if (data != NULL) { diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h index 8c61a4fe1db..d68c9f267c5 100644 --- a/drivers/scsi/pcmcia/nsp_cs.h +++ b/drivers/scsi/pcmcia/nsp_cs.h @@ -224,7 +224,6 @@ typedef struct scsi_info_t { struct pcmcia_device *p_dev; struct Scsi_Host *host; - dev_node_t node; int stop; } scsi_info_t; diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c index c3a4428dbcf..f0fc6baed9f 100644 --- a/drivers/scsi/pcmcia/qlogic_stub.c +++ b/drivers/scsi/pcmcia/qlogic_stub.c @@ -82,7 +82,6 @@ static struct scsi_host_template qlogicfas_driver_template = { typedef struct scsi_info_t { struct pcmcia_device *p_dev; - dev_node_t node; struct Scsi_Host *host; unsigned short manf_id; } scsi_info_t; @@ -235,8 +234,6 @@ static int qlogic_config(struct pcmcia_device * link) goto failed; } - sprintf(info->node.dev_name, "scsi%d", host->host_no); - link->dev_node = &info->node; info->host = host; return 0; diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index 6eacf4ca200..a5116417117 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c @@ -191,7 +191,6 @@ struct scsi_info_t { struct pcmcia_device *p_dev; - dev_node_t node; struct Scsi_Host *host; unsigned short manf_id; }; @@ -792,8 +791,6 @@ SYM53C500_config(struct pcmcia_device *link) */ data->fast_pio = USE_FAST_PIO; - sprintf(info->node.dev_name, "scsi%d", host->host_no); - link->dev_node = &info->node; info->host = host; if (scsi_add_host(host, NULL)) diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c index 6459252ed37..dadd686c980 100644 --- a/drivers/serial/serial_cs.c +++ b/drivers/serial/serial_cs.c @@ -89,7 +89,6 @@ struct serial_info { int manfid; int prodid; int c950ctrl; - dev_node_t node[4]; int line[4]; const struct serial_quirk *quirk; }; @@ -289,8 +288,6 @@ static void serial_remove(struct pcmcia_device *link) for (i = 0; i < info->ndev; i++) serial8250_unregister_port(info->line[i]); - info->p_dev->dev_node = NULL; - if (!info->slave) pcmcia_disable_device(link); } @@ -410,11 +407,6 @@ static int setup_serial(struct pcmcia_device *handle, struct serial_info * info, } info->line[info->ndev] = line; - sprintf(info->node[info->ndev].dev_name, "ttyS%d", line); - info->node[info->ndev].major = TTY_MAJOR; - info->node[info->ndev].minor = 0x40 + line; - if (info->ndev > 0) - info->node[info->ndev - 1].next = &info->node[info->ndev]; info->ndev++; return 0; @@ -711,7 +703,6 @@ static int serial_config(struct pcmcia_device * link) if (info->quirk->post(link)) goto failed; - link->dev_node = &info->node[0]; return 0; failed: diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c index d442fd35620..99cb2246ac7 100644 --- a/drivers/telephony/ixj_pcmcia.c +++ b/drivers/telephony/ixj_pcmcia.c @@ -22,7 +22,6 @@ typedef struct ixj_info_t { int ndev; - dev_node_t node; struct ixj *port; } ixj_info_t; @@ -155,8 +154,6 @@ static int ixj_config(struct pcmcia_device * link) j = ixj_pcmcia_probe(link->io.BasePort1, link->io.BasePort1 + 0x10); info->ndev = 1; - info->node.major = PHONE_MAJOR; - link->dev_node = &info->node; ixj_get_serial(link, j); return 0; diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c index 60fddf363d5..df110df52a8 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c @@ -234,7 +234,6 @@ static int pdacf_config(struct pcmcia_device *link) if (snd_pdacf_assign_resources(pdacf, link->io.BasePort1, link->irq) < 0) goto failed; - link->dev_node = &pdacf->node; return 0; failed: diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.h b/sound/pcmcia/pdaudiocf/pdaudiocf.h index b0601838112..a0a7ec64222 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.h +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.h @@ -117,7 +117,6 @@ struct snd_pdacf { /* pcmcia stuff */ struct pcmcia_device *p_dev; - dev_node_t node; }; static inline void pdacf_reg_write(struct snd_pdacf *chip, unsigned char reg, unsigned short val) diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index 5eced7a7c98..624b47a85f0 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c @@ -211,7 +211,6 @@ static int snd_vxpocket_assign_resources(struct vx_core *chip, int port, int irq static int vxpocket_config(struct pcmcia_device *link) { struct vx_core *chip = link->priv; - struct snd_vxpocket *vxp = (struct snd_vxpocket *)chip; int ret; snd_printdd(KERN_DEBUG "vxpocket_config called\n"); @@ -245,7 +244,6 @@ static int vxpocket_config(struct pcmcia_device *link) if (snd_vxpocket_assign_resources(chip, link->io.BasePort1, link->irq) < 0) goto failed; - link->dev_node = &vxp->node; return 0; failed: diff --git a/sound/pcmcia/vx/vxpocket.h b/sound/pcmcia/vx/vxpocket.h index 27ea002294c..ea4df16a28e 100644 --- a/sound/pcmcia/vx/vxpocket.h +++ b/sound/pcmcia/vx/vxpocket.h @@ -43,7 +43,6 @@ struct snd_vxpocket { /* pcmcia stuff */ struct pcmcia_device *p_dev; - dev_node_t node; }; extern struct snd_vx_ops snd_vxpocket_ops; -- cgit v1.2.3-70-g09d2 From ded6a1a341cb38c4cfeb09d3d01ffe16b5c804b3 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sat, 20 Mar 2010 19:35:12 +0100 Subject: pcmcia: dev_node removal (drivers with updated printk call) As a second step, remove any usage of dev_node_t from drivers which only wrote to this typedef/struct, except one printk() which can easily be replaced by a dev_info()/dev_warn() call. CC: Harald Welte CC: linux-ide@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: netdev@vger.kernel.org CC: linux-usb@vger.kernel.org Acked-by: Karsten Keil Signed-off-by: Dominik Brodowski --- drivers/char/pcmcia/cm4000_cs.c | 9 +----- drivers/char/pcmcia/synclink_cs.c | 10 ++----- drivers/ide/ide-cs.c | 12 +++----- drivers/isdn/hardware/avm/avm_cs.c | 60 ++++---------------------------------- drivers/isdn/hisax/elsa_cs.c | 27 ++--------------- drivers/isdn/hisax/sedlbauer_cs.c | 37 ++--------------------- drivers/isdn/hisax/teles_cs.c | 37 ++--------------------- drivers/net/wireless/airo_cs.c | 47 ++--------------------------- drivers/usb/host/sl811_cs.c | 10 ++----- 9 files changed, 22 insertions(+), 227 deletions(-) (limited to 'drivers/net') diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index 90b199f97be..e7956acf2ad 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c @@ -106,7 +106,6 @@ static int major; /* major number we get from the kernel */ struct cm4000_dev { struct pcmcia_device *p_dev; - dev_node_t node; /* OS node (major,minor) */ unsigned char atr[MAX_ATR]; unsigned char rbuf[512]; @@ -884,8 +883,7 @@ static void monitor_card(unsigned long p) /* slow down warning, but prompt immediately after insertion */ if (dev->cwarn == 0 || dev->cwarn == 10) { set_bit(IS_BAD_CARD, &dev->flags); - printk(KERN_WARNING MODULE_NAME ": device %s: ", - dev->node.dev_name); + dev_warn(&dev->p_dev->dev, MODULE_NAME ": "); if (test_bit(IS_BAD_CSUM, &dev->flags)) { DEBUGP(4, dev, "ATR checksum (0x%.2x, should " "be zero) failed\n", dev->atr_csum); @@ -1781,11 +1779,6 @@ static int cm4000_config(struct pcmcia_device * link, int devno) goto cs_release; dev = link->priv; - sprintf(dev->node.dev_name, DEVICE_NAME "%d", devno); - dev->node.major = major; - dev->node.minor = devno; - dev->node.next = NULL; - link->dev_node = &dev->node; return 0; diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 027690b70d2..308903ec8bf 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c @@ -220,7 +220,6 @@ typedef struct _mgslpc_info { /* PCMCIA support */ struct pcmcia_device *p_dev; - dev_node_t node; int stop; /* SPPP/Cisco HDLC device parts */ @@ -614,13 +613,8 @@ static int mgslpc_config(struct pcmcia_device *link) info->io_base = link->io.BasePort1; info->irq_level = link->irq; - /* add to linked list of devices */ - sprintf(info->node.dev_name, "mgslpc0"); - info->node.major = info->node.minor = 0; - link->dev_node = &info->node; - - printk(KERN_INFO "%s: index 0x%02x:", - info->node.dev_name, link->conf.ConfigIndex); + dev_info(&link->dev, "index 0x%02x:", + link->conf.ConfigIndex); if (link->conf.Attributes & CONF_ENABLE_IRQ) printk(", irq %d", link->irq); if (link->io.NumPorts1) diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c index 17ad91e453e..0b7815d2581 100644 --- a/drivers/ide/ide-cs.c +++ b/drivers/ide/ide-cs.c @@ -65,8 +65,7 @@ MODULE_LICENSE("Dual MPL/GPL"); typedef struct ide_info_t { struct pcmcia_device *p_dev; struct ide_host *host; - int ndev; - dev_node_t node; + int ndev; } ide_info_t; static void ide_release(struct pcmcia_device *); @@ -308,13 +307,10 @@ static int ide_config(struct pcmcia_device *link) goto failed; info->ndev = 1; - sprintf(info->node.dev_name, "hd%c", 'a' + host->ports[0]->index * 2); - info->node.major = host->ports[0]->major; - info->node.minor = 0; info->host = host; - link->dev_node = &info->node; - printk(KERN_INFO "ide-cs: %s: Vpp = %d.%d\n", - info->node.dev_name, link->conf.Vpp / 10, link->conf.Vpp % 10); + dev_info(&link->dev, "ide-cs: hd%c: Vpp = %d.%d\n", + 'a' + host->ports[0]->index * 2, + link->conf.Vpp / 10, link->conf.Vpp % 10); kfree(stk); return 0; diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c index 0d485f6c219..8bbc452ff59 100644 --- a/drivers/isdn/hardware/avm/avm_cs.c +++ b/drivers/isdn/hardware/avm/avm_cs.c @@ -61,31 +61,6 @@ static void avmcs_release(struct pcmcia_device *link); static void avmcs_detach(struct pcmcia_device *p_dev); -/* - A linked list of "instances" of the skeleton device. Each actual - PCMCIA card corresponds to one device instance, and is described - by one struct pcmcia_device structure (defined in ds.h). - - You may not want to use a linked list for this -- for example, the - memory card driver uses an array of struct pcmcia_device pointers, where minor - device numbers are used to derive the corresponding array index. -*/ - -/* - A driver needs to provide a dev_node_t structure for each device - on a card. In some cases, there is only one device per card (for - example, ethernet cards, modems). In other cases, there may be - many actual or logical devices (SCSI adapters, memory cards with - multiple partitions). The dev_node_t structures need to be kept - in a linked list starting at the 'dev' field of a struct pcmcia_device - structure. We allocate them in the card's private data structure, - because they generally can't be allocated dynamically. -*/ - -typedef struct local_info_t { - dev_node_t node; -} local_info_t; - /*====================================================================== avmcs_attach() creates an "instance" of the driver, allocating @@ -100,7 +75,6 @@ typedef struct local_info_t { static int avmcs_probe(struct pcmcia_device *p_dev) { - local_info_t *local; /* The io structure describes IO port mapping */ p_dev->io.NumPorts1 = 16; @@ -113,16 +87,7 @@ static int avmcs_probe(struct pcmcia_device *p_dev) p_dev->conf.ConfigIndex = 1; p_dev->conf.Present = PRESENT_OPTION; - /* Allocate space for private device-specific data */ - local = kzalloc(sizeof(local_info_t), GFP_KERNEL); - if (!local) - goto err; - p_dev->priv = local; - return avmcs_config(p_dev); - - err: - return -ENOMEM; } /* avmcs_attach */ /*====================================================================== @@ -137,7 +102,6 @@ static int avmcs_probe(struct pcmcia_device *p_dev) static void avmcs_detach(struct pcmcia_device *link) { avmcs_release(link); - kfree(link->priv); } /* avmcs_detach */ /*====================================================================== @@ -168,14 +132,11 @@ static int avmcs_configcheck(struct pcmcia_device *p_dev, static int avmcs_config(struct pcmcia_device *link) { - local_info_t *dev; int i = -1; char devname[128]; int cardtype; int (*addcard)(unsigned int port, unsigned irq); - dev = link->priv; - devname[0] = 0; if (link->prod_id[1]) strlcpy(devname, link->prod_id[1], sizeof(devname)); @@ -204,15 +165,11 @@ static int avmcs_config(struct pcmcia_device *link) } while (0); - /* At this point, the dev_node_t structure(s) should be - initialized and arranged in a linked list at link->dev. */ - if (devname[0]) { char *s = strrchr(devname, ' '); if (!s) s = devname; else s++; - strcpy(dev->node.dev_name, s); if (strcmp("M1", s) == 0) { cardtype = AVM_CARDTYPE_M1; } else if (strcmp("M2", s) == 0) { @@ -220,14 +177,8 @@ static int avmcs_config(struct pcmcia_device *link) } else { cardtype = AVM_CARDTYPE_B1; } - } else { - strcpy(dev->node.dev_name, "b1"); + } else cardtype = AVM_CARDTYPE_B1; - } - - dev->node.major = 64; - dev->node.minor = 0; - link->dev_node = &dev->node; /* If any step failed, release any partially configured state */ if (i != 0) { @@ -243,12 +194,11 @@ static int avmcs_config(struct pcmcia_device *link) case AVM_CARDTYPE_B1: addcard = b1pcmcia_addcard_b1; break; } if ((i = (*addcard)(link->io.BasePort1, link->irq)) < 0) { - printk(KERN_ERR "avm_cs: failed to add AVM-%s-Controller at i/o %#x, irq %d\n", - dev->node.dev_name, link->io.BasePort1, link->irq); - avmcs_release(link); - return -ENODEV; + dev_err(&link->dev, "avm_cs: failed to add AVM-Controller at i/o %#x, irq %d\n", + link->io.BasePort1, link->irq); + avmcs_release(link); + return -ENODEV; } - dev->node.minor = i; return 0; } /* avmcs_config */ diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c index 8e170e4b7cf..218927e3a4e 100644 --- a/drivers/isdn/hisax/elsa_cs.c +++ b/drivers/isdn/hisax/elsa_cs.c @@ -87,24 +87,8 @@ static void elsa_cs_release(struct pcmcia_device *link); static void elsa_cs_detach(struct pcmcia_device *p_dev) __devexit; -/* - A driver needs to provide a dev_node_t structure for each device - on a card. In some cases, there is only one device per card (for - example, ethernet cards, modems). In other cases, there may be - many actual or logical devices (SCSI adapters, memory cards with - multiple partitions). The dev_node_t structures need to be kept - in a linked list starting at the 'dev' field of a struct pcmcia_device - structure. We allocate them in the card's private data structure, - because they generally shouldn't be allocated dynamically. - In this case, we also provide a flag to indicate if a device is - "stopped" due to a power management event, or card ejection. The - device IO routines can use a flag like this to throttle IO to a - card that is not ready to accept it. -*/ - typedef struct local_info_t { struct pcmcia_device *p_dev; - dev_node_t node; int busy; int cardnr; } local_info_t; @@ -226,16 +210,9 @@ static int __devinit elsa_cs_config(struct pcmcia_device *link) if (i != 0) goto failed; - /* At this point, the dev_node_t structure(s) should be - initialized and arranged in a linked list at link->dev. *//* */ - sprintf(dev->node.dev_name, "elsa"); - dev->node.major = dev->node.minor = 0x0; - - link->dev_node = &dev->node; - /* Finally, report what we've done */ - printk(KERN_INFO "%s: index 0x%02x: ", - dev->node.dev_name, link->conf.ConfigIndex); + dev_info(&link->dev, "index 0x%02x: ", + link->conf.ConfigIndex); if (link->conf.Attributes & CONF_ENABLE_IRQ) printk(", irq %d", link->irq); if (link->io.NumPorts1) diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c index 7778385b05b..1f4feaab21a 100644 --- a/drivers/isdn/hisax/sedlbauer_cs.c +++ b/drivers/isdn/hisax/sedlbauer_cs.c @@ -87,32 +87,8 @@ static void sedlbauer_release(struct pcmcia_device *link); static void sedlbauer_detach(struct pcmcia_device *p_dev) __devexit; -/* - You'll also need to prototype all the functions that will actually - be used to talk to your device. See 'memory_cs' for a good example - of a fully self-sufficient driver; the other drivers rely more or - less on other parts of the kernel. -*/ - -/* - A driver needs to provide a dev_node_t structure for each device - on a card. In some cases, there is only one device per card (for - example, ethernet cards, modems). In other cases, there may be - many actual or logical devices (SCSI adapters, memory cards with - multiple partitions). The dev_node_t structures need to be kept - in a linked list starting at the 'dev' field of a struct pcmcia_device - structure. We allocate them in the card's private data structure, - because they generally shouldn't be allocated dynamically. - - In this case, we also provide a flag to indicate if a device is - "stopped" due to a power management event, or card ejection. The - device IO routines can use a flag like this to throttle IO to a - card that is not ready to accept it. -*/ - typedef struct local_info_t { struct pcmcia_device *p_dev; - dev_node_t node; int stop; int cardnr; } local_info_t; @@ -279,7 +255,6 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev, static int __devinit sedlbauer_config(struct pcmcia_device *link) { - local_info_t *dev = link->priv; win_req_t *req; int ret; IsdnCard_t icard; @@ -315,17 +290,9 @@ static int __devinit sedlbauer_config(struct pcmcia_device *link) if (ret) goto failed; - /* - At this point, the dev_node_t structure(s) need to be - initialized and arranged in a linked list at link->dev. - */ - sprintf(dev->node.dev_name, "sedlbauer"); - dev->node.major = dev->node.minor = 0; - link->dev_node = &dev->node; - /* Finally, report what we've done */ - printk(KERN_INFO "%s: index 0x%02x:", - dev->node.dev_name, link->conf.ConfigIndex); + dev_info(&link->dev, "index 0x%02x:", + link->conf.ConfigIndex); if (link->conf.Vpp) printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); if (link->conf.Attributes & CONF_ENABLE_IRQ) diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c index 02dec13f25e..5771955cc53 100644 --- a/drivers/isdn/hisax/teles_cs.c +++ b/drivers/isdn/hisax/teles_cs.c @@ -68,34 +68,8 @@ static void teles_cs_release(struct pcmcia_device *link); static void teles_detach(struct pcmcia_device *p_dev) __devexit ; -/* - A linked list of "instances" of the teles_cs device. Each actual - PCMCIA card corresponds to one device instance, and is described - by one struct pcmcia_device structure (defined in ds.h). - - You may not want to use a linked list for this -- for example, the - memory card driver uses an array of struct pcmcia_device pointers, where minor - device numbers are used to derive the corresponding array index. -*/ - -/* - A driver needs to provide a dev_node_t structure for each device - on a card. In some cases, there is only one device per card (for - example, ethernet cards, modems). In other cases, there may be - many actual or logical devices (SCSI adapters, memory cards with - multiple partitions). The dev_node_t structures need to be kept - in a linked list starting at the 'dev' field of a struct pcmcia_device - structure. We allocate them in the card's private data structure, - because they generally shouldn't be allocated dynamically. - In this case, we also provide a flag to indicate if a device is - "stopped" due to a power management event, or card ejection. The - device IO routines can use a flag like this to throttle IO to a - card that is not ready to accept it. -*/ - typedef struct local_info_t { struct pcmcia_device *p_dev; - dev_node_t node; int busy; int cardnr; } local_info_t; @@ -216,16 +190,9 @@ static int __devinit teles_cs_config(struct pcmcia_device *link) if (i != 0) goto cs_failed; - /* At this point, the dev_node_t structure(s) should be - initialized and arranged in a linked list at link->dev. *//* */ - sprintf(dev->node.dev_name, "teles"); - dev->node.major = dev->node.minor = 0x0; - - link->dev_node = &dev->node; - /* Finally, report what we've done */ - printk(KERN_INFO "%s: index 0x%02x:", - dev->node.dev_name, link->conf.ConfigIndex); + dev_info(&link->dev, "index 0x%02x:", + link->conf.ConfigIndex); if (link->conf.Attributes & CONF_ENABLE_IRQ) printk(", irq %d", link->irq); if (link->io.NumPorts1) diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c index 7867c51be15..33bdc6a84e8 100644 --- a/drivers/net/wireless/airo_cs.c +++ b/drivers/net/wireless/airo_cs.c @@ -75,42 +75,7 @@ static void airo_release(struct pcmcia_device *link); static void airo_detach(struct pcmcia_device *p_dev); -/* - You'll also need to prototype all the functions that will actually - be used to talk to your device. See 'pcmem_cs' for a good example - of a fully self-sufficient driver; the other drivers rely more or - less on other parts of the kernel. -*/ - -/* - A linked list of "instances" of the aironet device. Each actual - PCMCIA card corresponds to one device instance, and is described - by one struct pcmcia_device structure (defined in ds.h). - - You may not want to use a linked list for this -- for example, the - memory card driver uses an array of struct pcmcia_device pointers, - where minor device numbers are used to derive the corresponding - array index. -*/ - -/* - A driver needs to provide a dev_node_t structure for each device - on a card. In some cases, there is only one device per card (for - example, ethernet cards, modems). In other cases, there may be - many actual or logical devices (SCSI adapters, memory cards with - multiple partitions). The dev_node_t structures need to be kept - in a linked list starting at the 'dev' field of a struct pcmcia_device - structure. We allocate them in the card's private data structure, - because they generally shouldn't be allocated dynamically. - - In this case, we also provide a flag to indicate if a device is - "stopped" due to a power management event, or card ejection. The - device IO routines can use a flag like this to throttle IO to a - card that is not ready to accept it. -*/ - typedef struct local_info_t { - dev_node_t node; struct net_device *eth_dev; } local_info_t; @@ -311,17 +276,9 @@ static int airo_config(struct pcmcia_device *link) if (!((local_info_t *)link->priv)->eth_dev) goto failed; - /* - At this point, the dev_node_t structure(s) need to be - initialized and arranged in a linked list at link->dev_node. - */ - strcpy(dev->node.dev_name, ((local_info_t *)link->priv)->eth_dev->name); - dev->node.major = dev->node.minor = 0; - link->dev_node = &dev->node; - /* Finally, report what we've done */ - printk(KERN_INFO "%s: index 0x%02x: ", - dev->node.dev_name, link->conf.ConfigIndex); + dev_info(&link->dev, "index 0x%02x: ", + link->conf.ConfigIndex); if (link->conf.Vpp) printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); printk(", irq %d", link->irq); diff --git a/drivers/usb/host/sl811_cs.c b/drivers/usb/host/sl811_cs.c index a712788f9b1..58cb73c8420 100644 --- a/drivers/usb/host/sl811_cs.c +++ b/drivers/usb/host/sl811_cs.c @@ -47,7 +47,6 @@ static const char driver_name[DEV_NAME_LEN] = "sl811_cs"; typedef struct local_info_t { struct pcmcia_device *p_dev; - dev_node_t node; } local_info_t; static void sl811_cs_release(struct pcmcia_device * link); @@ -185,7 +184,6 @@ static int sl811_cs_config_check(struct pcmcia_device *p_dev, static int sl811_cs_config(struct pcmcia_device *link) { struct device *parent = &link->dev; - local_info_t *dev = link->priv; int ret; dev_dbg(&link->dev, "sl811_cs_config\n"); @@ -204,12 +202,8 @@ static int sl811_cs_config(struct pcmcia_device *link) if (ret) goto failed; - sprintf(dev->node.dev_name, driver_name); - dev->node.major = dev->node.minor = 0; - link->dev_node = &dev->node; - - printk(KERN_INFO "%s: index 0x%02x: ", - dev->node.dev_name, link->conf.ConfigIndex); + dev_info(&link->dev, "index 0x%02x: ", + link->conf.ConfigIndex); if (link->conf.Vpp) printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10); printk(", irq %d", link->irq); -- cgit v1.2.3-70-g09d2 From c7c2fa079073ab92b0736a161b4cf1051a3e631f Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sat, 20 Mar 2010 19:39:26 +0100 Subject: pcmcia: dev_node removal (drivers with unregister_netdev check) As a third step, remove any usage of dev_node_t from drivers which only wrote to this typedef/struct, except to determine whether register_netdev() succeeded previously. However, the function calling unregister_netdev() was only ever called by the PCMCIA core if register_netdev() succeeded previously. The lonely exception was easily fixed. CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org Signed-off-by: Dominik Brodowski --- drivers/net/pcmcia/3c574_cs.c | 8 +------- drivers/net/pcmcia/3c589_cs.c | 9 +-------- drivers/net/pcmcia/axnet_cs.c | 8 +------- drivers/net/pcmcia/com20020_cs.c | 21 +++++++-------------- drivers/net/pcmcia/fmvj18x_cs.c | 8 +------- drivers/net/pcmcia/ibmtr_cs.c | 8 +------- drivers/net/pcmcia/nmclan_cs.c | 8 +------- drivers/net/pcmcia/pcnet_cs.c | 8 +------- drivers/net/pcmcia/smc91c92_cs.c | 9 +-------- drivers/net/pcmcia/xirc2ps_cs.c | 29 +---------------------------- drivers/net/wireless/orinoco/orinoco_cs.c | 14 +------------- drivers/net/wireless/orinoco/spectrum_cs.c | 14 +------------- drivers/net/wireless/ray_cs.c | 6 +----- drivers/net/wireless/ray_cs.h | 1 - drivers/net/wireless/wl3501.h | 1 - drivers/net/wireless/wl3501_cs.c | 15 +++------------ 16 files changed, 22 insertions(+), 145 deletions(-) (limited to 'drivers/net') diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index 14428317c00..774e41c7def 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c @@ -200,7 +200,6 @@ enum Window4 { /* Window 4: Xcvr/media bits. */ struct el3_private { struct pcmcia_device *p_dev; - dev_node_t node; u16 advertising, partner; /* NWay media advertisement */ unsigned char phys; /* MII device address */ unsigned int autoselect:1, default_media:3; /* Read from the EEPROM/Wn3_Config. */ @@ -309,8 +308,7 @@ static void tc574_detach(struct pcmcia_device *link) dev_dbg(&link->dev, "3c574_detach()\n"); - if (link->dev_node) - unregister_netdev(dev); + unregister_netdev(dev); tc574_release(link); @@ -444,17 +442,13 @@ static int tc574_config(struct pcmcia_device *link) } } - link->dev_node = &lp->node; SET_NETDEV_DEV(dev, &link->dev); if (register_netdev(dev) != 0) { printk(KERN_NOTICE "3c574_cs: register_netdev() failed\n"); - link->dev_node = NULL; goto failed; } - strcpy(lp->node.dev_name, dev->name); - printk(KERN_INFO "%s: %s at io %#3lx, irq %d, " "hw_addr %pM.\n", dev->name, cardname, dev->base_addr, dev->irq, diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index 405d772bfde..5ab589d3b38 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c @@ -106,7 +106,6 @@ enum RxFilter { struct el3_private { struct pcmcia_device *p_dev; - dev_node_t node; /* For transceiver monitoring */ struct timer_list media; u16 media_status; @@ -222,8 +221,7 @@ static void tc589_detach(struct pcmcia_device *link) dev_dbg(&link->dev, "3c589_detach\n"); - if (link->dev_node) - unregister_netdev(dev); + unregister_netdev(dev); tc589_release(link); @@ -241,7 +239,6 @@ static void tc589_detach(struct pcmcia_device *link) static int tc589_config(struct pcmcia_device *link) { struct net_device *dev = link->priv; - struct el3_private *lp = netdev_priv(dev); __be16 *phys_addr; int ret, i, j, multi = 0, fifo; unsigned int ioaddr; @@ -312,17 +309,13 @@ static int tc589_config(struct pcmcia_device *link) else printk(KERN_ERR "3c589_cs: invalid if_port requested\n"); - link->dev_node = &lp->node; SET_NETDEV_DEV(dev, &link->dev); if (register_netdev(dev) != 0) { printk(KERN_ERR "3c589_cs: register_netdev() failed\n"); - link->dev_node = NULL; goto failed; } - strcpy(lp->node.dev_name, dev->name); - printk(KERN_INFO "%s: 3Com 3c%s, io %#3lx, irq %d, " "hw_addr %pM\n", dev->name, (multi ? "562" : "589"), dev->base_addr, dev->irq, diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 967547a84b4..59f6fa3c9dd 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c @@ -113,7 +113,6 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id); typedef struct axnet_dev_t { struct pcmcia_device *p_dev; - dev_node_t node; caddr_t base; struct timer_list watchdog; int stale, fast_poll; @@ -194,8 +193,7 @@ static void axnet_detach(struct pcmcia_device *link) dev_dbg(&link->dev, "axnet_detach(0x%p)\n", link); - if (link->dev_node) - unregister_netdev(dev); + unregister_netdev(dev); axnet_release(link); @@ -392,17 +390,13 @@ static int axnet_config(struct pcmcia_device *link) } info->phy_id = (i < 32) ? i : -1; - link->dev_node = &info->node; SET_NETDEV_DEV(dev, &link->dev); if (register_netdev(dev) != 0) { printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n"); - link->dev_node = NULL; goto failed; } - strcpy(info->node.dev_name, dev->name); - printk(KERN_INFO "%s: Asix AX88%d90: io %#3lx, irq %d, " "hw_addr %pM\n", dev->name, ((info->flags & IS_AX88790) ? 7 : 1), diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c index 278438beb91..5643f94541b 100644 --- a/drivers/net/pcmcia/com20020_cs.c +++ b/drivers/net/pcmcia/com20020_cs.c @@ -122,7 +122,6 @@ static void com20020_detach(struct pcmcia_device *p_dev); typedef struct com20020_dev_t { struct net_device *dev; - dev_node_t node; } com20020_dev_t; /*====================================================================== @@ -195,18 +194,16 @@ static void com20020_detach(struct pcmcia_device *link) dev_dbg(&link->dev, "com20020_detach\n"); - if (link->dev_node) { - dev_dbg(&link->dev, "unregister...\n"); + dev_dbg(&link->dev, "unregister...\n"); - unregister_netdev(dev); + unregister_netdev(dev); - /* - * this is necessary because we register our IRQ separately - * from card services. - */ - if (dev->irq) + /* + * this is necessary because we register our IRQ separately + * from card services. + */ + if (dev->irq) free_irq(dev->irq, dev); - } com20020_release(link); @@ -297,7 +294,6 @@ static int com20020_config(struct pcmcia_device *link) lp->card_name = "PCMCIA COM20020"; lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */ - link->dev_node = &info->node; SET_NETDEV_DEV(dev, &link->dev); i = com20020_found(dev, 0); /* calls register_netdev */ @@ -305,12 +301,9 @@ static int com20020_config(struct pcmcia_device *link) if (i != 0) { dev_printk(KERN_NOTICE, &link->dev, "com20020_cs: com20020_found() failed\n"); - link->dev_node = NULL; goto failed; } - strcpy(info->node.dev_name, dev->name); - dev_dbg(&link->dev,KERN_INFO "%s: port %#3lx, irq %d\n", dev->name, dev->base_addr, dev->irq); return 0; diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c index 31f1a037737..6580d78397d 100644 --- a/drivers/net/pcmcia/fmvj18x_cs.c +++ b/drivers/net/pcmcia/fmvj18x_cs.c @@ -110,7 +110,6 @@ typedef enum { MBH10302, MBH10304, TDK, CONTEC, LA501, UNGERMANN, */ typedef struct local_info_t { struct pcmcia_device *p_dev; - dev_node_t node; long open_time; uint tx_started:1; uint tx_queue; @@ -274,8 +273,7 @@ static void fmvj18x_detach(struct pcmcia_device *link) dev_dbg(&link->dev, "fmvj18x_detach\n"); - if (link->dev_node) - unregister_netdev(dev); + unregister_netdev(dev); fmvj18x_release(link); @@ -523,17 +521,13 @@ static int fmvj18x_config(struct pcmcia_device *link) } lp->cardtype = cardtype; - link->dev_node = &lp->node; SET_NETDEV_DEV(dev, &link->dev); if (register_netdev(dev) != 0) { printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n"); - link->dev_node = NULL; goto failed; } - strcpy(lp->node.dev_name, dev->name); - /* print current configuration */ printk(KERN_INFO "%s: %s, sram %s, port %#3lx, irq %d, " "hw_addr %pM\n", diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index 0225cdffa4b..2e42d80f8ca 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c @@ -104,7 +104,6 @@ static void ibmtr_detach(struct pcmcia_device *p_dev); typedef struct ibmtr_dev_t { struct pcmcia_device *p_dev; struct net_device *dev; - dev_node_t node; window_handle_t sram_win_handle; struct tok_info *ti; } ibmtr_dev_t; @@ -190,8 +189,7 @@ static void ibmtr_detach(struct pcmcia_device *link) */ ti->sram_phys |= 1; - if (link->dev_node) - unregister_netdev(dev); + unregister_netdev(dev); del_timer_sync(&(ti->tr_timer)); @@ -289,18 +287,14 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) Adapters Technical Reference" SC30-3585 for this info. */ ibmtr_hw_setup(dev, mmiobase); - link->dev_node = &info->node; SET_NETDEV_DEV(dev, &link->dev); i = ibmtr_probe_card(dev); if (i != 0) { printk(KERN_NOTICE "ibmtr_cs: register_netdev() failed\n"); - link->dev_node = NULL; goto failed; } - strcpy(info->node.dev_name, dev->name); - printk(KERN_INFO "%s: port %#3lx, irq %d, mmio %#5lx, sram %#5lx, hwaddr=%pM\n", dev->name, dev->base_addr, dev->irq, diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index b779e3a0b4d..d8a3b3cf246 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c @@ -363,7 +363,6 @@ typedef struct _mace_statistics { typedef struct _mace_private { struct pcmcia_device *p_dev; - dev_node_t node; struct net_device_stats linux_stats; /* Linux statistics counters */ mace_statistics mace_stats; /* MACE chip statistics counters */ @@ -491,8 +490,7 @@ static void nmclan_detach(struct pcmcia_device *link) dev_dbg(&link->dev, "nmclan_detach\n"); - if (link->dev_node) - unregister_netdev(dev); + unregister_netdev(dev); nmclan_release(link); @@ -696,18 +694,14 @@ static int nmclan_config(struct pcmcia_device *link) else printk(KERN_NOTICE "nmclan_cs: invalid if_port requested\n"); - link->dev_node = &lp->node; SET_NETDEV_DEV(dev, &link->dev); i = register_netdev(dev); if (i != 0) { printk(KERN_NOTICE "nmclan_cs: register_netdev() failed\n"); - link->dev_node = NULL; goto failed; } - strcpy(lp->node.dev_name, dev->name); - printk(KERN_INFO "%s: nmclan: port %#3lx, irq %d, %s port," " hw_addr %pM\n", dev->name, dev->base_addr, dev->irq, if_names[dev->if_port], diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index af09be48757..6f77a768ba8 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c @@ -208,7 +208,6 @@ static hw_info_t dl10022_info = { 0, 0, 0, 0, IS_DL10022|HAS_MII }; typedef struct pcnet_dev_t { struct pcmcia_device *p_dev; - dev_node_t node; u_int flags; void __iomem *base; struct timer_list watchdog; @@ -287,8 +286,7 @@ static void pcnet_detach(struct pcmcia_device *link) dev_dbg(&link->dev, "pcnet_detach\n"); - if (link->dev_node) - unregister_netdev(dev); + unregister_netdev(dev); pcnet_release(link); @@ -639,17 +637,13 @@ static int pcnet_config(struct pcmcia_device *link) if (info->flags & (IS_DL10019|IS_DL10022)) mii_phy_probe(dev); - link->dev_node = &info->node; SET_NETDEV_DEV(dev, &link->dev); if (register_netdev(dev) != 0) { printk(KERN_NOTICE "pcnet_cs: register_netdev() failed\n"); - link->dev_node = NULL; goto failed; } - strcpy(info->node.dev_name, dev->name); - if (info->flags & (IS_DL10019|IS_DL10022)) { u_char id = inb(dev->base_addr + 0x1a); printk(KERN_INFO "%s: NE2000 (DL100%d rev %02x): ", diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index ad061c7106b..59796e7d09c 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c @@ -103,7 +103,6 @@ struct smc_private { u_short manfid; u_short cardid; - dev_node_t node; struct sk_buff *saved_skb; int packets_waiting; void __iomem *base; @@ -323,7 +322,6 @@ static int smc91c92_probe(struct pcmcia_device *link) return -ENOMEM; smc = netdev_priv(dev); smc->p_dev = link; - link->priv = dev; spin_lock_init(&smc->lock); link->io.NumPorts1 = 16; @@ -361,8 +359,7 @@ static void smc91c92_detach(struct pcmcia_device *link) dev_dbg(&link->dev, "smc91c92_detach\n"); - if (link->dev_node) - unregister_netdev(dev); + unregister_netdev(dev); smc91c92_release(link); @@ -956,17 +953,13 @@ static int smc91c92_config(struct pcmcia_device *link) SMC_SELECT_BANK(0); } - link->dev_node = &smc->node; SET_NETDEV_DEV(dev, &link->dev); if (register_netdev(dev) != 0) { printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n"); - link->dev_node = NULL; goto config_undo; } - strcpy(smc->node.dev_name, dev->name); - printk(KERN_INFO "%s: smc91c%s rev %d: io %#3lx, irq %d, " "hw_addr %pM\n", dev->name, name, (rev & 0x0f), dev->base_addr, dev->irq, diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index c9e7d7d4783..5e6b62ba888 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c @@ -297,31 +297,9 @@ static void xirc2ps_detach(struct pcmcia_device *p_dev); static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id); -/**************** - * A linked list of "instances" of the device. Each actual - * PCMCIA card corresponds to one device instance, and is described - * by one struct pcmcia_device structure (defined in ds.h). - * - * You may not want to use a linked list for this -- for example, the - * memory card driver uses an array of struct pcmcia_device pointers, where minor - * device numbers are used to derive the corresponding array index. - */ - -/**************** - * A driver needs to provide a dev_node_t structure for each device - * on a card. In some cases, there is only one device per card (for - * example, ethernet cards, modems). In other cases, there may be - * many actual or logical devices (SCSI adapters, memory cards with - * multiple partitions). The dev_node_t structures need to be kept - * in a linked list starting at the 'dev' field of a struct pcmcia_device - * structure. We allocate them in the card's private data structure, - * because they generally can't be allocated dynamically. - */ - typedef struct local_info_t { struct net_device *dev; struct pcmcia_device *p_dev; - dev_node_t node; int card_type; int probe_port; @@ -579,8 +557,7 @@ xirc2ps_detach(struct pcmcia_device *link) dev_dbg(&link->dev, "detach\n"); - if (link->dev_node) - unregister_netdev(dev); + unregister_netdev(dev); xirc2ps_release(link); @@ -985,17 +962,13 @@ xirc2ps_config(struct pcmcia_device * link) if (local->dingo) do_reset(dev, 1); /* a kludge to make the cem56 work */ - link->dev_node = &local->node; SET_NETDEV_DEV(dev, &link->dev); if ((err=register_netdev(dev))) { printk(KNOT_XIRC "register_netdev() failed\n"); - link->dev_node = NULL; goto config_error; } - strcpy(local->node.dev_name, dev->name); - /* give some infos about the hardware */ printk(KERN_INFO "%s: %s: port %#3lx, irq %d, hwaddr %pM\n", dev->name, local->manf_str,(u_long)dev->base_addr, (int)dev->irq, diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c index 5d29b11fdbc..03056ab7303 100644 --- a/drivers/net/wireless/orinoco/orinoco_cs.c +++ b/drivers/net/wireless/orinoco/orinoco_cs.c @@ -50,7 +50,6 @@ MODULE_PARM_DESC(ignore_cis_vcc, "Allow voltage mismatch between card and socket * struct orinoco_private */ struct orinoco_pccard { struct pcmcia_device *p_dev; - dev_node_t node; /* Used to handle hard reset */ /* yuck, we need this hack to work around the insanity of the @@ -140,8 +139,7 @@ static void orinoco_cs_detach(struct pcmcia_device *link) { struct orinoco_private *priv = link->priv; - if (link->dev_node) - orinoco_if_del(priv); + orinoco_if_del(priv); orinoco_cs_release(link); @@ -226,7 +224,6 @@ static int orinoco_cs_config(struct pcmcia_device *link) { struct orinoco_private *priv = link->priv; - struct orinoco_pccard *card = priv->card; hermes_t *hw = &priv->hw; int ret; void __iomem *mem; @@ -276,9 +273,6 @@ orinoco_cs_config(struct pcmcia_device *link) if (ret) goto failed; - /* Ok, we have the configuration, prepare to register the netdev */ - card->node.major = card->node.minor = 0; - /* Initialise the main driver */ if (orinoco_init(priv) != 0) { printk(KERN_ERR PFX "orinoco_init() failed\n"); @@ -292,12 +286,6 @@ orinoco_cs_config(struct pcmcia_device *link) goto failed; } - /* At this point, the dev_node_t structure(s) needs to be - * initialized and arranged in a linked list at link->dev_node. */ - strcpy(card->node.dev_name, priv->ndev->name); - link->dev_node = &card->node; /* link->dev_node being non-NULL is also - * used to indicate that the - * net_device has been registered */ return 0; failed: diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c index 7a8e056cd62..41b9ce42585 100644 --- a/drivers/net/wireless/orinoco/spectrum_cs.c +++ b/drivers/net/wireless/orinoco/spectrum_cs.c @@ -57,7 +57,6 @@ MODULE_PARM_DESC(ignore_cis_vcc, "Allow voltage mismatch between card and socket * struct orinoco_private */ struct orinoco_pccard { struct pcmcia_device *p_dev; - dev_node_t node; }; /********************************************************************/ @@ -214,8 +213,7 @@ static void spectrum_cs_detach(struct pcmcia_device *link) { struct orinoco_private *priv = link->priv; - if (link->dev_node) - orinoco_if_del(priv); + orinoco_if_del(priv); spectrum_cs_release(link); @@ -300,7 +298,6 @@ static int spectrum_cs_config(struct pcmcia_device *link) { struct orinoco_private *priv = link->priv; - struct orinoco_pccard *card = priv->card; hermes_t *hw = &priv->hw; int ret; void __iomem *mem; @@ -350,9 +347,6 @@ spectrum_cs_config(struct pcmcia_device *link) if (ret) goto failed; - /* Ok, we have the configuration, prepare to register the netdev */ - card->node.major = card->node.minor = 0; - /* Reset card */ if (spectrum_cs_hard_reset(priv) != 0) goto failed; @@ -370,12 +364,6 @@ spectrum_cs_config(struct pcmcia_device *link) goto failed; } - /* At this point, the dev_node_t structure(s) needs to be - * initialized and arranged in a linked list at link->dev_node. */ - strcpy(card->node.dev_name, priv->ndev->name); - link->dev_node = &card->node; /* link->dev_node being non-NULL is also - * used to indicate that the - * net_device has been registered */ return 0; failed: diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index fe4642a49bf..18a93f1adcc 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c @@ -379,8 +379,7 @@ static void ray_detach(struct pcmcia_device *link) del_timer(&local->timer); if (link->priv) { - if (link->dev_node) - unregister_netdev(dev); + unregister_netdev(dev); free_netdev(dev); } dev_dbg(&link->dev, "ray_cs ray_detach ending\n"); @@ -489,9 +488,6 @@ static int ray_config(struct pcmcia_device *link) return i; } - strcpy(local->node.dev_name, dev->name); - link->dev_node = &local->node; - printk(KERN_INFO "%s: RayLink, irq %d, hw_addr %pM\n", dev->name, dev->irq, dev->dev_addr); diff --git a/drivers/net/wireless/ray_cs.h b/drivers/net/wireless/ray_cs.h index 1e23b7f4cca..9f01ddb1974 100644 --- a/drivers/net/wireless/ray_cs.h +++ b/drivers/net/wireless/ray_cs.h @@ -25,7 +25,6 @@ struct beacon_rx { typedef struct ray_dev_t { int card_status; int authentication_state; - dev_node_t node; window_handle_t amem_handle; /* handle to window for attribute memory */ window_handle_t rmem_handle; /* handle to window for rx buffer on card */ void __iomem *sram; /* pointer to beginning of shared RAM */ diff --git a/drivers/net/wireless/wl3501.h b/drivers/net/wireless/wl3501.h index 8bce1a550a2..8816e371fd0 100644 --- a/drivers/net/wireless/wl3501.h +++ b/drivers/net/wireless/wl3501.h @@ -610,7 +610,6 @@ struct wl3501_card { struct iw_statistics wstats; struct iw_spy_data spy_data; struct iw_public_data wireless_data; - struct dev_node_t node; struct pcmcia_device *p_dev; }; #endif diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c index c43f05b98c4..5e5d24c1ce2 100644 --- a/drivers/net/wireless/wl3501_cs.c +++ b/drivers/net/wireless/wl3501_cs.c @@ -1451,6 +1451,8 @@ static void wl3501_detach(struct pcmcia_device *link) netif_device_detach(dev); wl3501_release(link); + unregister_netdev(dev); + if (link->priv) free_netdev(link->priv); @@ -1977,20 +1979,15 @@ static int wl3501_config(struct pcmcia_device *link) } this = netdev_priv(dev); - /* - * At this point, the dev_node_t structure(s) should be initialized and - * arranged in a linked list at link->dev_node. - */ - link->dev_node = &this->node; this->base_addr = dev->base_addr; if (!wl3501_get_flash_mac_addr(this)) { printk(KERN_WARNING "%s: Cant read MAC addr in flash ROM?\n", dev->name); + unregister_netdev(dev); goto failed; } - strcpy(this->node.dev_name, dev->name); for (i = 0; i < 6; i++) dev->dev_addr[i] = ((char *)&this->mac_addr)[i]; @@ -2034,12 +2031,6 @@ failed: */ static void wl3501_release(struct pcmcia_device *link) { - struct net_device *dev = link->priv; - - /* Unlink the device chain */ - if (link->dev_node) - unregister_netdev(dev); - pcmcia_disable_device(link); } -- cgit v1.2.3-70-g09d2 From 4b49291aca7ea60a3da645c8f9fa8b2d6efee120 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sat, 20 Mar 2010 14:06:24 +0100 Subject: pcmcia: remove unused mem_op.h Signed-off-by: Dominik Brodowski --- drivers/net/pcmcia/3c574_cs.c | 1 - drivers/net/wireless/ray_cs.c | 1 - drivers/staging/netwave/netwave_cs.c | 1 - include/pcmcia/mem_op.h | 116 ----------------------------------- 4 files changed, 119 deletions(-) delete mode 100644 include/pcmcia/mem_op.h (limited to 'drivers/net') diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index 774e41c7def..30b7cf70fbe 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c @@ -93,7 +93,6 @@ earlier 3Com products. #include #include #include -#include #include #include diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 18a93f1adcc..f7d2a34ca53 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c @@ -51,7 +51,6 @@ #include #include #include -#include #include #include diff --git a/drivers/staging/netwave/netwave_cs.c b/drivers/staging/netwave/netwave_cs.c index 449e6a5c19e..f1ee2cbc840 100644 --- a/drivers/staging/netwave/netwave_cs.c +++ b/drivers/staging/netwave/netwave_cs.c @@ -61,7 +61,6 @@ #include #include #include -#include #include #include diff --git a/include/pcmcia/mem_op.h b/include/pcmcia/mem_op.h deleted file mode 100644 index 0fa06e5d537..00000000000 --- a/include/pcmcia/mem_op.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * mem_op.h - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * The initial developer of the original code is David A. Hinds - * . Portions created by David A. Hinds - * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. - * - * (C) 1999 David A. Hinds - */ - -#ifndef _LINUX_MEM_OP_H -#define _LINUX_MEM_OP_H - -#include -#include - -/* - If UNSAFE_MEMCPY is defined, we use the (optimized) system routines - to copy between a card and kernel memory. These routines do 32-bit - operations which may not work with all PCMCIA controllers. The - safe versions defined here will do only 8-bit and 16-bit accesses. -*/ - -#ifdef UNSAFE_MEMCPY - -#define copy_from_pc memcpy_fromio -#define copy_to_pc memcpy_toio - -static inline void copy_pc_to_user(void *to, const void *from, size_t n) -{ - size_t odd = (n & 3); - n -= odd; - while (n) { - put_user(__raw_readl(from), (int *)to); - (char *)from += 4; (char *)to += 4; n -= 4; - } - while (odd--) - put_user(readb((char *)from++), (char *)to++); -} - -static inline void copy_user_to_pc(void *to, const void *from, size_t n) -{ - int l; - char c; - size_t odd = (n & 3); - n -= odd; - while (n) { - get_user(l, (int *)from); - __raw_writel(l, to); - (char *)to += 4; (char *)from += 4; n -= 4; - } - while (odd--) { - get_user(c, (char *)from++); - writeb(c, (char *)to++); - } -} - -#else /* UNSAFE_MEMCPY */ - -static inline void copy_from_pc(void *to, void __iomem *from, size_t n) -{ - __u16 *t = to; - __u16 __iomem *f = from; - size_t odd = (n & 1); - for (n >>= 1; n; n--) - *t++ = __raw_readw(f++); - if (odd) - *(__u8 *)t = readb(f); -} - -static inline void copy_to_pc(void __iomem *to, const void *from, size_t n) -{ - __u16 __iomem *t = to; - const __u16 *f = from; - size_t odd = (n & 1); - for (n >>= 1; n ; n--) - __raw_writew(*f++, t++); - if (odd) - writeb(*(__u8 *)f, t); -} - -static inline void copy_pc_to_user(void __user *to, void __iomem *from, size_t n) -{ - __u16 __user *t = to; - __u16 __iomem *f = from; - size_t odd = (n & 1); - for (n >>= 1; n ; n--) - put_user(__raw_readw(f++), t++); - if (odd) - put_user(readb(f), (char __user *)t); -} - -static inline void copy_user_to_pc(void __iomem *to, void __user *from, size_t n) -{ - __u16 __user *f = from; - __u16 __iomem *t = to; - short s; - char c; - size_t odd = (n & 1); - for (n >>= 1; n; n--) { - get_user(s, f++); - __raw_writew(s, t++); - } - if (odd) { - get_user(c, (char __user *)f); - writeb(c, t); - } -} - -#endif /* UNSAFE_MEMCPY */ - -#endif /* _LINUX_MEM_OP_H */ -- cgit v1.2.3-70-g09d2