Release coccinelle-0.1
[bpt/coccinelle.git] / tests / bad_subsumption.c
1 static int __devinit snd_vx222_create(struct snd_card *card, struct pci_dev *pci,
2 struct snd_vx_hardware *hw,
3 struct snd_vx222 **rchip)
4 {
5 struct vx_core *chip;
6 struct snd_vx222 *vx;
7 static struct snd_device_ops ops = {
8 .dev_free = snd_vx222_dev_free,
9 };
10 chip = snd_vx_create(card, hw, vx_ops,
11 sizeof(struct snd_vx222) - sizeof(struct vx_core));
12 if (! chip) {
13 pci_disable_device(pci);
14 return -ENOMEM;
15 }
16 vx = (struct snd_vx222 *)chip;
17 vx->pci = pci;
18
19 if ((err = pci_request_regions(pci, CARD_NAME)) < 0) {
20 snd_vx222_free(chip);
21 return 0;
22 }
23 for (i = 0; i < 2; i++)
24 vx->port[i] = pci_resource_start(pci, i + 1);
25
26 if (request_irq(pci->irq, snd_vx_irq_handler, IRQF_SHARED,
27 CARD_NAME, chip)) {
28 snd_vx222_free(chip);
29 return -EBUSY;
30 }
31 chip->irq = pci->irq;
32
33 if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
34 snd_vx222_free(chip);
35 return 0;
36 }
37
38
39 return 0;
40 }