Re: [alsa-devel] [PATCH] Turtle Beach Multisound Classic/Pinnacle driver (4th rev)
At Sat, 24 Jan 2009 13:35:28 +0100, Krzysztof Helt wrote:
From: Krzysztof Helt krzysztof.h1@wp.pl
This is driver for Turtle Beach Multisound cards: Classic, Fiji and Pinnacle.
Tested pcm playback and recording and MIDI playback on Multisound Pinnacle.
Signed-off-by: Krzysztof Helt krzysztof.h1@wp.pl
All issues pointed by Takashi are resolved. I moved more code to the common part and made a common library.
Thanks, this looks pretty good. But, one thing I forgot to ask...
+static int __devinit snd_msnd_isa_probe(struct device *pdev, unsigned int idx) +{
- int err;
- struct snd_card *card;
- struct snd_msnd *chip;
- if (isapnp[idx] || cfg[idx] == SNDRV_AUTO_PORT) {
printk(KERN_INFO LOGNAME ": Assuming PnP mode\n");
return -ENODEV;
- }
- card = snd_card_new(index[idx], id[idx], THIS_MODULE,
sizeof(struct snd_msnd));
- if (!card)
return -ENOMEM;
Could you use the new API snd_card_create() introduced recently?
+#ifdef CONFIG_PNP +static int __devinit snd_msnd_pnp_detect(struct pnp_card_link *pcard,
const struct pnp_card_device_id *pid)
+{
...
- /*
* Create a new ALSA sound card entry, in anticipation
* of detecting our hardware ...
*/
- card = snd_card_new(index[idx], id[idx], THIS_MODULE,
sizeof(struct snd_msnd));
- if (!card)
return -ENOMEM;
Ditto.
thanks,
Takashi
On Mon, 26 Jan 2009 09:56:02 +0100 Takashi Iwai tiwai@suse.de wrote:
Thanks, this looks pretty good. But, one thing I forgot to ask...
Could you use the new API snd_card_create() introduced recently?
The patch with conversion only is below.
--- From: Krzysztof Helt krzysztof.h1@wp.pl
Convert driver to use new snd_card_create() function.
Signed-off-by: Krzysztof Helt krzysztof.h1@wp.pl --- diff --git a/sound/isa/msnd/msnd_pinnacle.c b/sound/isa/msnd/msnd_pinnacle.c index b0231cf..845470b 100644 --- a/sound/isa/msnd/msnd_pinnacle.c +++ b/sound/isa/msnd/msnd_pinnacle.c @@ -893,10 +893,10 @@ static int __devinit snd_msnd_isa_probe(struct device *pdev, unsigned int idx) return -ENODEV; }
- card = snd_card_new(index[idx], id[idx], THIS_MODULE, - sizeof(struct snd_msnd)); - if (!card) - return -ENOMEM; + err = snd_card_create(index[idx], id[idx], THIS_MODULE, + sizeof(struct snd_msnd), &card); + if (err < 0) + return err;
snd_card_set_dev(card, pdev); chip = card->private_data; @@ -1113,10 +1113,10 @@ static int __devinit snd_msnd_pnp_detect(struct pnp_card_link *pcard, * Create a new ALSA sound card entry, in anticipation * of detecting our hardware ... */ - card = snd_card_new(index[idx], id[idx], THIS_MODULE, - sizeof(struct snd_msnd)); - if (!card) - return -ENOMEM; + ret = snd_card_create(index[idx], id[idx], THIS_MODULE, + sizeof(struct snd_msnd), &card); + if (ret < 0) + return ret;
chip = card->private_data; chip->card = card;
---------------------------------------------------------------------- Speak Up. Angielski szybko i skutecznie. 3 miesiace nauki gratis. Sprawdz. >> http://link.interia.pl/f2019
At Tue, 27 Jan 2009 21:44:10 +0100, Krzysztof Helt wrote:
On Mon, 26 Jan 2009 09:56:02 +0100 Takashi Iwai tiwai@suse.de wrote:
Thanks, this looks pretty good. But, one thing I forgot to ask...
Could you use the new API snd_card_create() introduced recently?
The patch with conversion only is below.
Thanks, now merged the patch into sound git tree. alsa-driver-build tree is updated so that snd-msnd-* drivers are built with the snapshot tarball, too.
Takashi
participants (2)
-
Krzysztof Helt
-
Takashi Iwai