aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/elsa_cs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-20 12:09:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-20 12:09:46 -0400
commit54291263519ac2c9bdda68b23b02fef3808deed4 (patch)
treed71de8172a6ab2bbe3068aece7d8911eeeb276fd /drivers/isdn/hisax/elsa_cs.c
parent46ee9645094ad1eb5b4888882ecaa1fb87dcd2a3 (diff)
parentacd200bf45487271d54f05938ad9e30f32a530ee (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (29 commits) pcmcia: disable PCMCIA ioctl also for ARM drivers/staging/comedi: dev_node removal (quatech_daqp_cs) drivers/staging/comedi: dev_node removal (ni_mio_cs) drivers/staging/comedi: dev_node removal (ni_labpc_cs) drivers/staging/comedi: dev_node removal (ni_daq_dio24) drivers/staging/comedi: dev_node removal (ni_daq_700) drivers/staging/comedi: dev_node removal (das08_cs) drivers/staging/comedi: dev_node removal (cb_das16_cs) pata_pcmcia: get rid of extra indirection pcmcia: remove suspend-related comment from yenta_socket.c pcmcia: call pcmcia_{read,write}_cis_mem with ops_mutex held pcmcia: remove pcmcia_add_device_lock pcmcia: update gfp/slab.h includes pcmcia: remove unused mem_op.h pcmcia: do not autoadd root PCI bus resources pcmcia: clarify alloc_io_space, move it to resource handlers pcmcia: move all pcmcia_resource_ops providers into one module pcmcia: move high level CIS access code to separate file pcmcia: dev_node removal (core) pcmcia: dev_node removal (remaining drivers) ...
Diffstat (limited to 'drivers/isdn/hisax/elsa_cs.c')
-rw-r--r--drivers/isdn/hisax/elsa_cs.c40
1 files changed, 5 insertions, 35 deletions
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index c9f2279e21f..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);
87 87
88static void elsa_cs_detach(struct pcmcia_device *p_dev) __devexit; 88static void elsa_cs_detach(struct pcmcia_device *p_dev) __devexit;
89 89
90/*
91 A driver needs to provide a dev_node_t structure for each device
92 on a card. In some cases, there is only one device per card (for
93 example, ethernet cards, modems). In other cases, there may be
94 many actual or logical devices (SCSI adapters, memory cards with
95 multiple partitions). The dev_node_t structures need to be kept
96 in a linked list starting at the 'dev' field of a struct pcmcia_device
97 structure. We allocate them in the card's private data structure,
98 because they generally shouldn't be allocated dynamically.
99 In this case, we also provide a flag to indicate if a device is
100 "stopped" due to a power management event, or card ejection. The
101 device IO routines can use a flag like this to throttle IO to a
102 card that is not ready to accept it.
103*/
104
105typedef struct local_info_t { 90typedef struct local_info_t {
106 struct pcmcia_device *p_dev; 91 struct pcmcia_device *p_dev;
107 dev_node_t node;
108 int busy; 92 int busy;
109 int cardnr; 93 int cardnr;
110} local_info_t; 94} local_info_t;
@@ -136,10 +120,6 @@ static int __devinit elsa_cs_probe(struct pcmcia_device *link)
136 120
137 local->cardnr = -1; 121 local->cardnr = -1;
138 122
139 /* Interrupt setup */
140 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
141 link->irq.Handler = NULL;
142
143 /* 123 /*
144 General socket configuration defaults can go here. In this 124 General socket configuration defaults can go here. In this
145 client, we assume very little, and rely on the CIS for almost 125 client, we assume very little, and rely on the CIS for almost
@@ -223,28 +203,18 @@ static int __devinit elsa_cs_config(struct pcmcia_device *link)
223 if (i != 0) 203 if (i != 0)
224 goto failed; 204 goto failed;
225 205
226 i = pcmcia_request_irq(link, &link->irq); 206 if (!link->irq)
227 if (i != 0) {
228 link->irq.AssignedIRQ = 0;
229 goto failed; 207 goto failed;
230 }
231 208
232 i = pcmcia_request_configuration(link, &link->conf); 209 i = pcmcia_request_configuration(link, &link->conf);
233 if (i != 0) 210 if (i != 0)
234 goto failed; 211 goto failed;
235 212
236 /* At this point, the dev_node_t structure(s) should be
237 initialized and arranged in a linked list at link->dev. *//* */
238 sprintf(dev->node.dev_name, "elsa");
239 dev->node.major = dev->node.minor = 0x0;
240
241 link->dev_node = &dev->node;
242
243 /* Finally, report what we've done */ 213 /* Finally, report what we've done */
244 printk(KERN_INFO "%s: index 0x%02x: ", 214 dev_info(&link->dev, "index 0x%02x: ",
245 dev->node.dev_name, link->conf.ConfigIndex); 215 link->conf.ConfigIndex);
246 if (link->conf.Attributes & CONF_ENABLE_IRQ) 216 if (link->conf.Attributes & CONF_ENABLE_IRQ)
247 printk(", irq %d", link->irq.AssignedIRQ); 217 printk(", irq %d", link->irq);
248 if (link->io.NumPorts1) 218 if (link->io.NumPorts1)
249 printk(", io 0x%04x-0x%04x", link->io.BasePort1, 219 printk(", io 0x%04x-0x%04x", link->io.BasePort1,
250 link->io.BasePort1+link->io.NumPorts1-1); 220 link->io.BasePort1+link->io.NumPorts1-1);
@@ -253,7 +223,7 @@ static int __devinit elsa_cs_config(struct pcmcia_device *link)
253 link->io.BasePort2+link->io.NumPorts2-1); 223 link->io.BasePort2+link->io.NumPorts2-1);
254 printk("\n"); 224 printk("\n");
255 225
256 icard.para[0] = link->irq.AssignedIRQ; 226 icard.para[0] = link->irq;
257 icard.para[1] = link->io.BasePort1; 227 icard.para[1] = link->io.BasePort1;
258 icard.protocol = protocol; 228 icard.protocol = protocol;
259 icard.typ = ISDN_CTYPE_ELSA_PCMCIA; 229 icard.typ = ISDN_CTYPE_ELSA_PCMCIA;