control: Minor documentation fixes.

Signed-off-by: Tanjeff-N. Moos <tanjeff@cccmz.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Tanjeff-N. Moos 2021-06-17 10:36:39 +02:00 committed by Takashi Iwai
parent ccc14ae897
commit 7ba3f888d0
3 changed files with 12 additions and 4 deletions

View file

@ -155,7 +155,7 @@ typedef struct _snd_ctl_elem_list snd_ctl_elem_list_t;
/** CTL element info container */ /** CTL element info container */
typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t; typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t;
/** CTL element value container /** CTL element value container.
* *
* Contains the value(s) (i.e. members) of a single element. All * Contains the value(s) (i.e. members) of a single element. All
* values of a given element are of the same type. * values of a given element are of the same type.
@ -167,6 +167,11 @@ typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t;
* using the latter, it must be freed again using * using the latter, it must be freed again using
* snd_ctl_elem_value_free(). * snd_ctl_elem_value_free().
* *
* A value object can be zeroed out using snd_ctl_elem_value_clear().
*
* A value object can be copied to another one using
* snd_ctl_elem_value_copy().
*
* \par Identifier * \par Identifier
* *
* Then, the ID must be filled. It is sufficient to fill only the * Then, the ID must be filled. It is sufficient to fill only the
@ -621,7 +626,7 @@ size_t snd_ctl_elem_value_sizeof(void);
* \brief Allocate an invalid #snd_ctl_elem_value_t on the stack. * \brief Allocate an invalid #snd_ctl_elem_value_t on the stack.
* *
* Allocate space for a value object on the stack. The allocated * Allocate space for a value object on the stack. The allocated
* memory need not be freed, because is on the stack. * memory need not be freed, because it is on the stack.
* *
* See snd_ctl_elem_value_t for details. * See snd_ctl_elem_value_t for details.
* *

View file

@ -147,6 +147,7 @@ int snd_card_get_index(const char *string)
return -EINVAL; return -EINVAL;
if ((isdigit(*string) && *(string + 1) == 0) || if ((isdigit(*string) && *(string + 1) == 0) ||
(isdigit(*string) && isdigit(*(string + 1)) && *(string + 2) == 0)) { (isdigit(*string) && isdigit(*(string + 1)) && *(string + 2) == 0)) {
/* We got an index */
if (sscanf(string, "%i", &card) != 1) if (sscanf(string, "%i", &card) != 1)
return -EINVAL; return -EINVAL;
if (card < 0 || card >= SND_MAX_CARDS) if (card < 0 || card >= SND_MAX_CARDS)
@ -156,8 +157,10 @@ int snd_card_get_index(const char *string)
return card; return card;
return err; return err;
} }
if (string[0] == '/') /* device name */ if (string[0] == '/')
/* We got a device name */
return snd_card_load2(string); return snd_card_load2(string);
/* We got in ID */
for (card = 0; card < SND_MAX_CARDS; card++) { for (card = 0; card < SND_MAX_CARDS; card++) {
#ifdef SUPPORT_ALOAD #ifdef SUPPORT_ALOAD
if (! snd_card_load(card)) if (! snd_card_load(card))

View file

@ -3127,7 +3127,7 @@ size_t snd_ctl_elem_value_sizeof()
/** /**
* \brief Allocate an invalid #snd_ctl_elem_value_t on the heap. * \brief Allocate an invalid #snd_ctl_elem_value_t on the heap.
* *
* Allocate space for a value object on the head. The allocated memory * Allocate space for a value object on the heap. The allocated memory
* must be freed using snd_ctl_elem_value_free(). * must be freed using snd_ctl_elem_value_free().
* *
* See snd_ctl_elem_value_t for details. * See snd_ctl_elem_value_t for details.