aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pcmcia/vx/vxpocket.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-05 04:45:09 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:15:57 -0500
commitfd238232cd0ff4840ae6946bb338502154096d88 (patch)
treed20e8f5871f7cff9d0867a84f6ba088fbffcbe28 /sound/pcmcia/vx/vxpocket.c
parenta78f4dd331a4f6a396eb5849656a4a72a70a56d7 (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 'sound/pcmcia/vx/vxpocket.c')
-rw-r--r--sound/pcmcia/vx/vxpocket.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c
index ff2f927559fc..87ec48c6af28 100644
--- a/sound/pcmcia/vx/vxpocket.c
+++ b/sound/pcmcia/vx/vxpocket.c
@@ -126,7 +126,8 @@ static struct snd_vx_hardware vxp440_hw = {
126/* 126/*
127 * create vxpocket instance 127 * create vxpocket instance
128 */ 128 */
129static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl) 129static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl,
130 struct pcmcia_device *p_dev)
130{ 131{
131 dev_link_t *link; /* Info for cardmgr */ 132 dev_link_t *link; /* Info for cardmgr */
132 struct vx_core *chip; 133 struct vx_core *chip;
@@ -135,6 +136,8 @@ static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl)
135 .dev_free = snd_vxpocket_dev_free, 136 .dev_free = snd_vxpocket_dev_free,
136 }; 137 };
137 138
139 link = dev_to_instance(p_dev);
140
138 chip = snd_vx_create(card, &vxpocket_hw, &snd_vxpocket_ops, 141 chip = snd_vx_create(card, &vxpocket_hw, &snd_vxpocket_ops,
139 sizeof(struct snd_vxpocket) - sizeof(struct vx_core)); 142 sizeof(struct snd_vxpocket) - sizeof(struct vx_core));
140 if (! chip) 143 if (! chip)
@@ -148,7 +151,7 @@ static struct snd_vxpocket *snd_vxpocket_new(struct snd_card *card, int ibl)
148 151
149 vxp = (struct snd_vxpocket *)chip; 152 vxp = (struct snd_vxpocket *)chip;
150 153
151 link = &vxp->link; 154 vxp->p_dev = p_dev;
152 link->priv = chip; 155 link->priv = chip;
153 156
154 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 157 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
@@ -263,7 +266,7 @@ static void vxpocket_config(dev_link_t *link)
263 if (snd_vxpocket_assign_resources(chip, link->io.BasePort1, link->irq.AssignedIRQ) < 0) 266 if (snd_vxpocket_assign_resources(chip, link->io.BasePort1, link->irq.AssignedIRQ) < 0)
264 goto failed; 267 goto failed;
265 268
266 link->dev = &vxp->node; 269 link->dev_node = &vxp->node;
267 link->state &= ~DEV_CONFIG_PENDING; 270 link->state &= ~DEV_CONFIG_PENDING;
268 kfree(parse); 271 kfree(parse);
269 return; 272 return;
@@ -339,7 +342,7 @@ static int vxpocket_attach(struct pcmcia_device *p_dev)
339 return -ENOMEM; 342 return -ENOMEM;
340 } 343 }
341 344
342 vxp = snd_vxpocket_new(card, ibl[i]); 345 vxp = snd_vxpocket_new(card, ibl[i], p_dev);
343 if (! vxp) { 346 if (! vxp) {
344 snd_card_free(card); 347 snd_card_free(card);
345 return -ENODEV; 348 return -ENODEV;
@@ -349,13 +352,10 @@ static int vxpocket_attach(struct pcmcia_device *p_dev)
349 vxp->index = i; 352 vxp->index = i;
350 card_alloc |= 1 << i; 353 card_alloc |= 1 << i;
351 354
352 /* Chain drivers */ 355 vxp->p_dev = p_dev;
353 vxp->link.next = NULL; 356 vxp->p_dev->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
354 357
355 vxp->link.handle = p_dev; 358 vxpocket_config(p_dev);
356 vxp->link.state |= DEV_PRESENT | DEV_CONFIG_PENDING;
357 p_dev->instance = &vxp->link;
358 vxpocket_config(&vxp->link);
359 359
360 return 0; 360 return 0;
361} 361}