diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-05 04:45:09 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:15:57 -0500 |
commit | fd238232cd0ff4840ae6946bb338502154096d88 (patch) | |
tree | d20e8f5871f7cff9d0867a84f6ba088fbffcbe28 /drivers/net/wireless/airo_cs.c | |
parent | a78f4dd331a4f6a396eb5849656a4a72a70a56d7 (diff) |
[PATCH] pcmcia: embed dev_link_t into struct pcmcia_device
Embed dev_link_t into struct pcmcia_device(), as they basically address the
same entity. The actual contents of dev_link_t will be cleaned up step by step.
This patch includes a bugfix from and signed-off-by Andrew Morton.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/wireless/airo_cs.c')
-rw-r--r-- | drivers/net/wireless/airo_cs.c | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c index 2216c04a02af..836c71ff7762 100644 --- a/drivers/net/wireless/airo_cs.c +++ b/drivers/net/wireless/airo_cs.c | |||
@@ -143,22 +143,14 @@ typedef struct local_info_t { | |||
143 | 143 | ||
144 | static int airo_attach(struct pcmcia_device *p_dev) | 144 | static int airo_attach(struct pcmcia_device *p_dev) |
145 | { | 145 | { |
146 | dev_link_t *link; | ||
147 | local_info_t *local; | 146 | local_info_t *local; |
148 | 147 | ||
149 | DEBUG(0, "airo_attach()\n"); | 148 | DEBUG(0, "airo_attach()\n"); |
150 | 149 | ||
151 | /* Initialize the dev_link_t structure */ | ||
152 | link = kzalloc(sizeof(struct dev_link_t), GFP_KERNEL); | ||
153 | if (!link) { | ||
154 | printk(KERN_ERR "airo_cs: no memory for new device\n"); | ||
155 | return -ENOMEM; | ||
156 | } | ||
157 | |||
158 | /* Interrupt setup */ | 150 | /* Interrupt setup */ |
159 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; | 151 | p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE; |
160 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; | 152 | p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID; |
161 | link->irq.Handler = NULL; | 153 | p_dev->irq.Handler = NULL; |
162 | 154 | ||
163 | /* | 155 | /* |
164 | General socket configuration defaults can go here. In this | 156 | General socket configuration defaults can go here. In this |
@@ -167,23 +159,19 @@ static int airo_attach(struct pcmcia_device *p_dev) | |||
167 | and attributes of IO windows) are fixed by the nature of the | 159 | and attributes of IO windows) are fixed by the nature of the |
168 | device, and can be hard-wired here. | 160 | device, and can be hard-wired here. |
169 | */ | 161 | */ |
170 | link->conf.Attributes = 0; | 162 | p_dev->conf.Attributes = 0; |
171 | link->conf.IntType = INT_MEMORY_AND_IO; | 163 | p_dev->conf.IntType = INT_MEMORY_AND_IO; |
172 | 164 | ||
173 | /* Allocate space for private device-specific data */ | 165 | /* Allocate space for private device-specific data */ |
174 | local = kzalloc(sizeof(local_info_t), GFP_KERNEL); | 166 | local = kzalloc(sizeof(local_info_t), GFP_KERNEL); |
175 | if (!local) { | 167 | if (!local) { |
176 | printk(KERN_ERR "airo_cs: no memory for new device\n"); | 168 | printk(KERN_ERR "airo_cs: no memory for new device\n"); |
177 | kfree (link); | ||
178 | return -ENOMEM; | 169 | return -ENOMEM; |
179 | } | 170 | } |
180 | link->priv = local; | 171 | p_dev->priv = local; |
181 | |||
182 | link->handle = p_dev; | ||
183 | p_dev->instance = link; | ||
184 | 172 | ||
185 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 173 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
186 | airo_config(link); | 174 | airo_config(p_dev); |
187 | 175 | ||
188 | return 0; | 176 | return 0; |
189 | } /* airo_attach */ | 177 | } /* airo_attach */ |
@@ -212,7 +200,6 @@ static void airo_detach(struct pcmcia_device *p_dev) | |||
212 | ((local_info_t*)link->priv)->eth_dev = NULL; | 200 | ((local_info_t*)link->priv)->eth_dev = NULL; |
213 | 201 | ||
214 | kfree(link->priv); | 202 | kfree(link->priv); |
215 | kfree(link); | ||
216 | } /* airo_detach */ | 203 | } /* airo_detach */ |
217 | 204 | ||
218 | /*====================================================================== | 205 | /*====================================================================== |
@@ -378,11 +365,11 @@ static void airo_config(dev_link_t *link) | |||
378 | 365 | ||
379 | /* | 366 | /* |
380 | At this point, the dev_node_t structure(s) need to be | 367 | At this point, the dev_node_t structure(s) need to be |
381 | initialized and arranged in a linked list at link->dev. | 368 | initialized and arranged in a linked list at link->dev_node. |
382 | */ | 369 | */ |
383 | strcpy(dev->node.dev_name, ((local_info_t*)link->priv)->eth_dev->name ); | 370 | strcpy(dev->node.dev_name, ((local_info_t*)link->priv)->eth_dev->name ); |
384 | dev->node.major = dev->node.minor = 0; | 371 | dev->node.major = dev->node.minor = 0; |
385 | link->dev = &dev->node; | 372 | link->dev_node = &dev->node; |
386 | 373 | ||
387 | /* Finally, report what we've done */ | 374 | /* Finally, report what we've done */ |
388 | printk(KERN_INFO "%s: index 0x%02x: ", | 375 | printk(KERN_INFO "%s: index 0x%02x: ", |