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

Commit e7356888 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

[media] 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 b9d4e7b0
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -145,11 +145,12 @@ static int snd_cx18_init(struct v4l2_device *v4l2_dev)
	/* This is a no-op for us.  We'll use the cx->instance */
	/* This is a no-op for us.  We'll use the cx->instance */


	/* (2) Create a card instance */
	/* (2) Create a card instance */
	ret = snd_card_create(SNDRV_DEFAULT_IDX1, /* use first available id */
	ret = snd_card_new(&cx->pci_dev->dev,
			   SNDRV_DEFAULT_IDX1, /* use first available id */
			   SNDRV_DEFAULT_STR1, /* xid from end of shortname*/
			   SNDRV_DEFAULT_STR1, /* xid from end of shortname*/
			   THIS_MODULE, 0, &sc);
			   THIS_MODULE, 0, &sc);
	if (ret) {
	if (ret) {
		CX18_ALSA_ERR("%s: snd_card_create() failed with err %d\n",
		CX18_ALSA_ERR("%s: snd_card_new() failed with err %d\n",
			      __func__, ret);
			      __func__, ret);
		goto err_exit;
		goto err_exit;
	}
	}
+2 −3
Original line number Original line Diff line number Diff line
@@ -489,7 +489,8 @@ struct cx23885_audio_dev *cx23885_audio_register(struct cx23885_dev *dev)
		return NULL;
		return NULL;
	}
	}


	err = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
	err = snd_card_new(&dev->pci->dev,
			   SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
			THIS_MODULE, sizeof(struct cx23885_audio_dev), &card);
			THIS_MODULE, sizeof(struct cx23885_audio_dev), &card);
	if (err < 0)
	if (err < 0)
		goto error;
		goto error;
@@ -500,8 +501,6 @@ struct cx23885_audio_dev *cx23885_audio_register(struct cx23885_dev *dev)
	chip->card = card;
	chip->card = card;
	spin_lock_init(&chip->lock);
	spin_lock_init(&chip->lock);


	snd_card_set_dev(card, &dev->pci->dev);

	err = snd_cx23885_pcm(chip, 0, "CX23885 Digital");
	err = snd_cx23885_pcm(chip, 0, "CX23885 Digital");
	if (err < 0)
	if (err < 0)
		goto error;
		goto error;
+3 −4
Original line number Original line Diff line number Diff line
@@ -645,7 +645,8 @@ static int cx25821_audio_initdev(struct cx25821_dev *dev)
		return -ENOENT;
		return -ENOENT;
	}
	}


	err = snd_card_create(index[devno], id[devno], THIS_MODULE,
	err = snd_card_new(&dev->pci->dev, index[devno], id[devno],
			   THIS_MODULE,
			   sizeof(struct cx25821_audio_dev), &card);
			   sizeof(struct cx25821_audio_dev), &card);
	if (err < 0) {
	if (err < 0) {
		pr_info("DEBUG ERROR: cannot create snd_card_new in %s\n",
		pr_info("DEBUG ERROR: cannot create snd_card_new in %s\n",
@@ -682,8 +683,6 @@ static int cx25821_audio_initdev(struct cx25821_dev *dev)
		goto error;
		goto error;
	}
	}


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

	strcpy(card->shortname, "cx25821");
	strcpy(card->shortname, "cx25821");
	sprintf(card->longname, "%s at 0x%lx irq %d", chip->dev->name,
	sprintf(card->longname, "%s at 0x%lx irq %d", chip->dev->name,
		chip->iobase, chip->irq);
		chip->iobase, chip->irq);
+2 −4
Original line number Original line Diff line number Diff line
@@ -852,8 +852,6 @@ static int snd_cx88_create(struct snd_card *card, struct pci_dev *pci,
	chip->irq = pci->irq;
	chip->irq = pci->irq;
	synchronize_irq(chip->irq);
	synchronize_irq(chip->irq);


	snd_card_set_dev(card, &pci->dev);

	*rchip = chip;
	*rchip = chip;
	*core_ptr = core;
	*core_ptr = core;


@@ -876,7 +874,7 @@ static int cx88_audio_initdev(struct pci_dev *pci,
		return (-ENOENT);
		return (-ENOENT);
	}
	}


	err = snd_card_create(index[devno], id[devno], THIS_MODULE,
	err = snd_card_new(&pci->dev, index[devno], id[devno], THIS_MODULE,
			   sizeof(snd_cx88_card_t), &card);
			   sizeof(snd_cx88_card_t), &card);
	if (err < 0)
	if (err < 0)
		return err;
		return err;
+5 −4
Original line number Original line Diff line number Diff line
@@ -145,11 +145,12 @@ static int snd_ivtv_init(struct v4l2_device *v4l2_dev)
	/* This is a no-op for us.  We'll use the itv->instance */
	/* This is a no-op for us.  We'll use the itv->instance */


	/* (2) Create a card instance */
	/* (2) Create a card instance */
	ret = snd_card_create(SNDRV_DEFAULT_IDX1, /* use first available id */
	ret = snd_card_new(&itv->pdev->dev,
			   SNDRV_DEFAULT_IDX1, /* use first available id */
			   SNDRV_DEFAULT_STR1, /* xid from end of shortname*/
			   SNDRV_DEFAULT_STR1, /* xid from end of shortname*/
			   THIS_MODULE, 0, &sc);
			   THIS_MODULE, 0, &sc);
	if (ret) {
	if (ret) {
		IVTV_ALSA_ERR("%s: snd_card_create() failed with err %d\n",
		IVTV_ALSA_ERR("%s: snd_card_new() failed with err %d\n",
			      __func__, ret);
			      __func__, ret);
		goto err_exit;
		goto err_exit;
	}
	}
Loading