[alsa-devel] [PATCH] Turtle Beach Multisound Classic/Pinnacle driver (4th rev)

Krzysztof Helt krzysztof.h1 at poczta.fm
Tue Jan 27 21:44:10 CET 2009


On Mon, 26 Jan 2009 09:56:02 +0100
Takashi Iwai <tiwai at 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 at wp.pl>

Convert driver to use new snd_card_create()
function.

Signed-off-by: Krzysztof Helt <krzysztof.h1 at 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



More information about the Alsa-devel mailing list