diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index 87a7c07ab6581ecd6a96d354ac5920e633548ea8..320384c1791bc1885bdf9940055a4af0694065f4 100644
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@ -492,9 +492,9 @@
}
/* (2) */
- card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
- if (card == NULL)
- return -ENOMEM;
+ err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
+ if (err < 0)
+ return err;
/* (3) */
err = snd_mychip_create(card, pci, &chip);
@@ -590,8 +590,9 @@
@@ -809,26 +810,28 @@
As mentioned above, to create a card instance, call
- snd_card_new().
+ snd_card_create().
- The function takes four arguments, the card-index number, the
+ The function takes five arguments, the card-index number, the
id string, the module pointer (usually
THIS_MODULE),
- and the size of extra-data space. The last argument is used to
+ the size of extra-data space, and the pointer to return the
+ card instance. The extra_size argument is used to
allocate card->private_data for the
chip-specific data. Note that these data
- are allocated by snd_card_new().
+ are allocated by snd_card_create().
@@ -915,15 +918,16 @@
- 1. Allocating via snd_card_new().
+ 1. Allocating via snd_card_create().
As mentioned above, you can pass the extra-data-length
- to the 4th argument of snd_card_new(), i.e.
+ to the 4th argument of snd_card_create(), i.e.
@@ -952,8 +956,8 @@
After allocating a card instance via
- snd_card_new() (with
- NULL on the 4th arg), call
+ snd_card_create() (with
+ 0 on the 4th arg), call
kzalloc().
@@ -961,7 +965,7 @@
@@ -5750,8 +5754,9 @@ struct _snd_pcm_runtime {
....
struct snd_card *card;
struct mychip *chip;
+ int err;
....
- card = snd_card_new(index[dev], id[dev], THIS_MODULE, NULL);
+ err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card);
....
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
....
@@ -5763,7 +5768,7 @@ struct _snd_pcm_runtime {
When you created the chip data with
- snd_card_new(), it's anyway accessible
+ snd_card_create(), it's anyway accessible
via private_data field.
@@ -5775,9 +5780,10 @@ struct _snd_pcm_runtime {
....
struct snd_card *card;
struct mychip *chip;
+ int err;
....
- card = snd_card_new(index[dev], id[dev], THIS_MODULE,
- sizeof(struct mychip));
+ err = snd_card_create(index[dev], id[dev], THIS_MODULE,
+ sizeof(struct mychip), &card);
....
chip = card->private_data;
....