Skip to content

Commit

Permalink
ALSA: doc: More kerneldoc comments on core components
Browse files Browse the repository at this point in the history
Some functions missed the proper kerneldoc comments.

Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Oct 30, 2014
1 parent 85926e0 commit eb9c38d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 13 deletions.
33 changes: 22 additions & 11 deletions sound/core/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,17 +438,6 @@ int snd_card_disconnect(struct snd_card *card)

EXPORT_SYMBOL(snd_card_disconnect);

/**
* snd_card_free - frees given soundcard structure
* @card: soundcard structure
*
* This function releases the soundcard structure and the all assigned
* devices automatically. That is, you don't have to release the devices
* by yourself.
*
* Return: Zero. Frees all associated devices and frees the control
* interface associated to given soundcard.
*/
static int snd_card_do_free(struct snd_card *card)
{
#if IS_ENABLED(CONFIG_SND_MIXER_OSS)
Expand All @@ -469,6 +458,15 @@ static int snd_card_do_free(struct snd_card *card)
return 0;
}

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

/**
* snd_card_free - frees given soundcard structure
* @card: soundcard structure
*
* This function releases the soundcard structure and the all assigned
* devices automatically. That is, you don't have to release the devices
* by yourself.
*
* This function waits until the all resources are properly released.
*
* Return: Zero. Frees all associated devices and frees the control
* interface associated to given soundcard.
*/
int snd_card_free(struct snd_card *card)
{
struct completion released;
Expand Down
9 changes: 7 additions & 2 deletions sound/core/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,13 @@ int snd_unregister_device(int type, struct snd_card *card, int dev)

EXPORT_SYMBOL(snd_unregister_device);

/* get the assigned device to the given type and device number;
* the caller needs to release it via put_device() after using it
/**
* snd_get_device - get the assigned device to the given type and device number
* @type: the device type, SNDRV_DEVICE_TYPE_XXX
* @card:the card instance
* @dev: the device index
*
* The caller needs to release it via put_device() after using it.
*/
struct device *snd_get_device(int type, struct snd_card *card, int dev)
{
Expand Down

0 comments on commit eb9c38d

Please sign in to comment.