Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60c5772b authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: pci: Convert to snd_card_new() with a device pointer



Also remove superfluous snd_card_set_dev() calls.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 4323cc4d
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -965,8 +965,6 @@ snd_ad1889_create(struct snd_card *card,
		return err;
		return err;
	}
	}


	snd_card_set_dev(card, &pci->dev);

	*rchip = chip;
	*rchip = chip;


	return 0;
	return 0;
@@ -996,7 +994,8 @@ snd_ad1889_probe(struct pci_dev *pci,
	}
	}


	/* (2) */
	/* (2) */
	err = snd_card_create(index[devno], id[devno], THIS_MODULE, 0, &card);
	err = snd_card_new(&pci->dev, index[devno], id[devno], THIS_MODULE,
			   0, &card);
	/* XXX REVISIT: we can probably allocate chip in this call */
	/* XXX REVISIT: we can probably allocate chip in this call */
	if (err < 0)
	if (err < 0)
		return err;
		return err;
+1 −3
Original line number Original line Diff line number Diff line
@@ -2218,8 +2218,6 @@ static int snd_ali_create(struct snd_card *card,
		return err;
		return err;
	}
	}


	snd_card_set_dev(card, &pci->dev);

	/* initialise synth voices*/
	/* initialise synth voices*/
	for (i = 0; i < ALI_CHANNELS; i++)
	for (i = 0; i < ALI_CHANNELS; i++)
		codec->synth.voices[i].number = i;
		codec->synth.voices[i].number = i;
@@ -2253,7 +2251,7 @@ static int snd_ali_probe(struct pci_dev *pci,


	snd_ali_printk("probe ...\n");
	snd_ali_printk("probe ...\n");


	err = snd_card_create(index, id, THIS_MODULE, 0, &card);
	err = snd_card_new(&pci->dev, index, id, THIS_MODULE, 0, &card);
	if (err < 0)
	if (err < 0)
		return err;
		return err;


+2 −3
Original line number Original line Diff line number Diff line
@@ -761,8 +761,6 @@ static int snd_als300_create(struct snd_card *card,
		return err;
		return err;
	}
	}


	snd_card_set_dev(card, &pci->dev);

	*rchip = chip;
	*rchip = chip;
	snd_als300_dbgcallleave();
	snd_als300_dbgcallleave();
	return 0;
	return 0;
@@ -829,7 +827,8 @@ static int snd_als300_probe(struct pci_dev *pci,
		return -ENOENT;
		return -ENOENT;
	}
	}


	err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
	err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
			   0, &card);


	if (err < 0)
	if (err < 0)
		return err;
		return err;
+3 −4
Original line number Original line Diff line number Diff line
@@ -888,7 +888,7 @@ static int snd_card_als4000_probe(struct pci_dev *pci,
	pci_write_config_word(pci, PCI_COMMAND, word | PCI_COMMAND_IO);
	pci_write_config_word(pci, PCI_COMMAND, word | PCI_COMMAND_IO);
	pci_set_master(pci);
	pci_set_master(pci);
	
	
	err = snd_card_create(index[dev], id[dev], THIS_MODULE, 
	err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
			   sizeof(*acard) /* private_data: acard */,
			   sizeof(*acard) /* private_data: acard */,
			   &card);
			   &card);
	if (err < 0) {
	if (err < 0) {
@@ -920,7 +920,6 @@ static int snd_card_als4000_probe(struct pci_dev *pci,


	chip->pci = pci;
	chip->pci = pci;
	chip->alt_port = iobase;
	chip->alt_port = iobase;
	snd_card_set_dev(card, &pci->dev);


	snd_als4000_configure(chip);
	snd_als4000_configure(chip);


+5 −11
Original line number Original line Diff line number Diff line
@@ -2827,16 +2827,12 @@ static int snd_asihpi_probe(struct pci_dev *pci_dev,
	hpi = pci_get_drvdata(pci_dev);
	hpi = pci_get_drvdata(pci_dev);
	adapter_index = hpi->adapter->index;
	adapter_index = hpi->adapter->index;
	/* first try to give the card the same index as its hardware index */
	/* first try to give the card the same index as its hardware index */
	err = snd_card_create(adapter_index,
	err = snd_card_new(&pci_dev->dev, adapter_index, id[adapter_index],
			      id[adapter_index], THIS_MODULE,
			   THIS_MODULE, sizeof(struct snd_card_asihpi), &card);
			      sizeof(struct snd_card_asihpi),
			      &card);
	if (err < 0) {
	if (err < 0) {
		/* if that fails, try the default index==next available */
		/* if that fails, try the default index==next available */
		err =
		err = snd_card_new(&pci_dev->dev, index[dev], id[dev],
		    snd_card_create(index[dev], id[dev],
				   THIS_MODULE, sizeof(struct snd_card_asihpi),
				    THIS_MODULE,
				    sizeof(struct snd_card_asihpi),
				   &card);
				   &card);
		if (err < 0)
		if (err < 0)
			return err;
			return err;
@@ -2845,8 +2841,6 @@ static int snd_asihpi_probe(struct pci_dev *pci_dev,
			adapter_index, card->number);
			adapter_index, card->number);
	}
	}


	snd_card_set_dev(card, &pci_dev->dev);

	asihpi = card->private_data;
	asihpi = card->private_data;
	asihpi->card = card;
	asihpi->card = card;
	asihpi->pci = pci_dev;
	asihpi->pci = pci_dev;
Loading