aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pcmcia/vx
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pcmcia/vx')
-rw-r--r--sound/pcmcia/vx/vxpocket.c20
-rw-r--r--sound/pcmcia/vx/vxpocket.h2
2 files changed, 11 insertions, 11 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}
diff --git a/sound/pcmcia/vx/vxpocket.h b/sound/pcmcia/vx/vxpocket.h
index 67efae3f6c8d..27ea002294c0 100644
--- a/sound/pcmcia/vx/vxpocket.h
+++ b/sound/pcmcia/vx/vxpocket.h
@@ -42,7 +42,7 @@ struct snd_vxpocket {
42 int index; /* card index */ 42 int index; /* card index */
43 43
44 /* pcmcia stuff */ 44 /* pcmcia stuff */
45 dev_link_t link; 45 struct pcmcia_device *p_dev;
46 dev_node_t node; 46 dev_node_t node;
47}; 47};
48 48