summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorRicardo Cerqueira <devnull@localhost>2005-12-30 15:57:25 +0000
committerRicardo Cerqueira <devnull@localhost>2005-12-30 15:57:25 +0000
commit33fff8a095bdbc04e45d9237f550ecea85cbc093 (patch)
treeb0207f7c8a30347bdc31a204c7911dff65f27bf0 /linux/drivers
parenteb599303c5d6acf7d232859e34cf96330fac6b56 (diff)
downloadmediapointer-dvb-s2-33fff8a095bdbc04e45d9237f550ecea85cbc093.tar.gz
mediapointer-dvb-s2-33fff8a095bdbc04e45d9237f550ecea85cbc093.tar.bz2
cx88-alsa, now with rmmod goodness
From: Ricardo Cerqueira <v4l@cerqueira.org> The module can now be removed and reloaded without problems, if the PCM isn't opened. PCM cleanup is still missing. Signed-off-by:
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/cx88/cx88-alsa.c31
1 files changed, 10 insertions, 21 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-alsa.c b/linux/drivers/media/video/cx88/cx88-alsa.c
index 9f912f5fe..9040fcc92 100644
--- a/linux/drivers/media/video/cx88/cx88-alsa.c
+++ b/linux/drivers/media/video/cx88/cx88-alsa.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-alsa.c,v 1.20 2005/12/30 06:22:40 rmcc Exp $
+ * $Id: cx88-alsa.c,v 1.21 2005/12/30 15:57:25 rmcc Exp $
*
* Support for audio capture
* PCI function #1 of the cx2388x.
@@ -956,7 +956,6 @@ static int snd_cx88_free(snd_cx88_card_t *chip)
iounmap(chip->mmio);
}
#endif
- pci_disable_device(chip->pci);
if (chip->irq >= 0){
synchronize_irq(chip->irq);
@@ -968,17 +967,18 @@ static int snd_cx88_free(snd_cx88_card_t *chip)
//pci_release_regions(chip->pci);
// btcx_riscmem_free(chip->pci,&chip->q.stopper);
-// cx88_core_put(chip->core,chip->pci);
+ cx88_core_put(chip->core,chip->pci);
//kfree(chip);
+ pci_disable_device(chip->pci);
return 0;
}
/*
* Component Destructor
*/
-static int snd_cx88_dev_free(snd_device_t *device)
+static int snd_cx88_dev_free(snd_card_t * card)
{
- snd_cx88_card_t *chip = device->device_data;
+ snd_cx88_card_t *chip = card->private_data;
dprintk(1,"cx88 dev free\n");
return snd_cx88_free(chip);
@@ -996,9 +996,6 @@ static int __devinit snd_cx88_create(snd_card_t *card, struct pci_dev *pci,
snd_cx88_card_t *chip;
struct cx88_core *core;
int err;
- static snd_device_ops_t ops = {
- .dev_free = snd_cx88_dev_free
- };
*rchip = NULL;
@@ -1013,12 +1010,7 @@ static int __devinit snd_cx88_create(snd_card_t *card, struct pci_dev *pci,
return err;
}
- chip = kmalloc(sizeof(*chip),GFP_KERNEL);
- if (NULL == chip) {
- pci_disable_device(pci);
- return -ENOMEM;
- }
- memset(chip,0,sizeof(*chip));
+ chip = (snd_cx88_card_t *) card->private_data;
/* pci init */
@@ -1094,11 +1086,6 @@ static int __devinit snd_cx88_create(snd_card_t *card, struct pci_dev *pci,
chip->irq = pci->irq;
synchronize_irq(chip->irq);
- err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
- if (err < 0) {
- snd_cx88_free(chip);
- return err;
- }
snd_card_set_dev(card, &pci->dev);
*rchip = chip;
@@ -1121,10 +1108,12 @@ static int __devinit cx88_audio_initdev(struct pci_dev *pci,
return (-ENOENT);
}
- card = snd_card_new(index[devno], id[devno], THIS_MODULE, 0);
+ card = snd_card_new(index[devno], id[devno], THIS_MODULE, sizeof(snd_cx88_card_t));
if (!card)
return (-ENOMEM);
+ card->private_free = snd_cx88_dev_free;
+
err = snd_cx88_create(card, pci, &chip);
if (err < 0)
return (err);
@@ -1186,7 +1175,7 @@ static void __devexit cx88_audio_finidev(struct pci_dev *pci)
snd_card_free((void *)card);
- kfree(card);
+ //kfree(card);
pci_set_drvdata(pci, NULL);