diff options
Diffstat (limited to 'drivers/net/wireless/atmel_cs.c')
-rw-r--r-- | drivers/net/wireless/atmel_cs.c | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c index 53fdaa22226d..522bbed47a05 100644 --- a/drivers/net/wireless/atmel_cs.c +++ b/drivers/net/wireless/atmel_cs.c | |||
@@ -154,22 +154,14 @@ typedef struct local_info_t { | |||
154 | 154 | ||
155 | static int atmel_attach(struct pcmcia_device *p_dev) | 155 | static int atmel_attach(struct pcmcia_device *p_dev) |
156 | { | 156 | { |
157 | dev_link_t *link; | ||
158 | local_info_t *local; | 157 | local_info_t *local; |
159 | 158 | ||
160 | DEBUG(0, "atmel_attach()\n"); | 159 | DEBUG(0, "atmel_attach()\n"); |
161 | 160 | ||
162 | /* Initialize the dev_link_t structure */ | ||
163 | link = kzalloc(sizeof(struct dev_link_t), GFP_KERNEL); | ||
164 | if (!link) { | ||
165 | printk(KERN_ERR "atmel_cs: no memory for new device\n"); | ||
166 | return -ENOMEM; | ||
167 | } | ||
168 | |||
169 | /* Interrupt setup */ | 161 | /* Interrupt setup */ |
170 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; | 162 | p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE; |
171 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; | 163 | p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID; |
172 | link->irq.Handler = NULL; | 164 | p_dev->irq.Handler = NULL; |
173 | 165 | ||
174 | /* | 166 | /* |
175 | General socket configuration defaults can go here. In this | 167 | General socket configuration defaults can go here. In this |
@@ -178,23 +170,19 @@ static int atmel_attach(struct pcmcia_device *p_dev) | |||
178 | and attributes of IO windows) are fixed by the nature of the | 170 | and attributes of IO windows) are fixed by the nature of the |
179 | device, and can be hard-wired here. | 171 | device, and can be hard-wired here. |
180 | */ | 172 | */ |
181 | link->conf.Attributes = 0; | 173 | p_dev->conf.Attributes = 0; |
182 | link->conf.IntType = INT_MEMORY_AND_IO; | 174 | p_dev->conf.IntType = INT_MEMORY_AND_IO; |
183 | 175 | ||
184 | /* Allocate space for private device-specific data */ | 176 | /* Allocate space for private device-specific data */ |
185 | local = kzalloc(sizeof(local_info_t), GFP_KERNEL); | 177 | local = kzalloc(sizeof(local_info_t), GFP_KERNEL); |
186 | if (!local) { | 178 | if (!local) { |
187 | printk(KERN_ERR "atmel_cs: no memory for new device\n"); | 179 | printk(KERN_ERR "atmel_cs: no memory for new device\n"); |
188 | kfree (link); | ||
189 | return -ENOMEM; | 180 | return -ENOMEM; |
190 | } | 181 | } |
191 | link->priv = local; | 182 | p_dev->priv = local; |
192 | |||
193 | link->handle = p_dev; | ||
194 | p_dev->instance = link; | ||
195 | 183 | ||
196 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 184 | p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
197 | atmel_config(link); | 185 | atmel_config(p_dev); |
198 | 186 | ||
199 | return 0; | 187 | return 0; |
200 | } /* atmel_attach */ | 188 | } /* atmel_attach */ |
@@ -218,7 +206,6 @@ static void atmel_detach(struct pcmcia_device *p_dev) | |||
218 | atmel_release(link); | 206 | atmel_release(link); |
219 | 207 | ||
220 | kfree(link->priv); | 208 | kfree(link->priv); |
221 | kfree(link); | ||
222 | } | 209 | } |
223 | 210 | ||
224 | /*====================================================================== | 211 | /*====================================================================== |
@@ -387,11 +374,11 @@ static void atmel_config(dev_link_t *link) | |||
387 | 374 | ||
388 | /* | 375 | /* |
389 | At this point, the dev_node_t structure(s) need to be | 376 | At this point, the dev_node_t structure(s) need to be |
390 | initialized and arranged in a linked list at link->dev. | 377 | initialized and arranged in a linked list at link->dev_node. |
391 | */ | 378 | */ |
392 | strcpy(dev->node.dev_name, ((local_info_t*)link->priv)->eth_dev->name ); | 379 | strcpy(dev->node.dev_name, ((local_info_t*)link->priv)->eth_dev->name ); |
393 | dev->node.major = dev->node.minor = 0; | 380 | dev->node.major = dev->node.minor = 0; |
394 | link->dev = &dev->node; | 381 | link->dev_node = &dev->node; |
395 | 382 | ||
396 | link->state &= ~DEV_CONFIG_PENDING; | 383 | link->state &= ~DEV_CONFIG_PENDING; |
397 | return; | 384 | return; |