Skip to content

Commit eb9c38d

Browse files
committed
ALSA: doc: More kerneldoc comments on core components
Some functions missed the proper kerneldoc comments. Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 85926e0 commit eb9c38d

2 files changed

Lines changed: 29 additions & 13 deletions

File tree

‎sound/core/init.c‎

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -438,17 +438,6 @@ int snd_card_disconnect(struct snd_card *card)
438438

439439
EXPORT_SYMBOL(snd_card_disconnect);
440440

441-
/**
442-
* snd_card_free - frees given soundcard structure
443-
* @card: soundcard structure
444-
*
445-
* This function releases the soundcard structure and the all assigned
446-
* devices automatically. That is, you don't have to release the devices
447-
* by yourself.
448-
*
449-
* Return: Zero. Frees all associated devices and frees the control
450-
* interface associated to given soundcard.
451-
*/
452441
static int snd_card_do_free(struct snd_card *card)
453442
{
454443
#if IS_ENABLED(CONFIG_SND_MIXER_OSS)
@@ -469,6 +458,15 @@ static int snd_card_do_free(struct snd_card *card)
469458
return 0;
470459
}
471460

461+
/**
462+
* snd_card_free_when_closed - Disconnect the card, free it later eventually
463+
* @card: soundcard structure
464+
*
465+
* Unlike snd_card_free(), this function doesn't try to release the card
466+
* resource immediately, but tries to disconnect at first. When the card
467+
* is still in use, the function returns before freeing the resources.
468+
* The card resources will be freed when the refcount gets to zero.
469+
*/
472470
int snd_card_free_when_closed(struct snd_card *card)
473471
{
474472
int ret = snd_card_disconnect(card);
@@ -479,6 +477,19 @@ int snd_card_free_when_closed(struct snd_card *card)
479477
}
480478
EXPORT_SYMBOL(snd_card_free_when_closed);
481479

480+
/**
481+
* snd_card_free - frees given soundcard structure
482+
* @card: soundcard structure
483+
*
484+
* This function releases the soundcard structure and the all assigned
485+
* devices automatically. That is, you don't have to release the devices
486+
* by yourself.
487+
*
488+
* This function waits until the all resources are properly released.
489+
*
490+
* Return: Zero. Frees all associated devices and frees the control
491+
* interface associated to given soundcard.
492+
*/
482493
int snd_card_free(struct snd_card *card)
483494
{
484495
struct completion released;

‎sound/core/sound.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,13 @@ int snd_unregister_device(int type, struct snd_card *card, int dev)
355355

356356
EXPORT_SYMBOL(snd_unregister_device);
357357

358-
/* get the assigned device to the given type and device number;
359-
* the caller needs to release it via put_device() after using it
358+
/**
359+
* snd_get_device - get the assigned device to the given type and device number
360+
* @type: the device type, SNDRV_DEVICE_TYPE_XXX
361+
* @card:the card instance
362+
* @dev: the device index
363+
*
364+
* The caller needs to release it via put_device() after using it.
360365
*/
361366
struct device *snd_get_device(int type, struct snd_card *card, int dev)
362367
{

0 commit comments

Comments
 (0)