Skip to content

Commit a3352f0

Browse files
Henrik KretzschmarJaroslav Kysela
authored andcommitted
[ALSA] Fix two typos and changes on snd_assert()
ALSA Core Both typos were in the kerneldocs. I splitted the snd_assert() calls in one-expression-per-call for better debugging. Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 7a318a7 commit a3352f0

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

‎sound/core/device.c‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* snd_device_new - create an ALSA device component
3030
* @card: the card instance
31-
* @type: the device type, SNDRV_DEV_TYPE_XXX
31+
* @type: the device type, SNDRV_DEV_XXX
3232
* @device_data: the data pointer of this device
3333
* @ops: the operator table
3434
*
@@ -46,7 +46,9 @@ int snd_device_new(snd_card_t *card, snd_device_type_t type,
4646
{
4747
snd_device_t *dev;
4848

49-
snd_assert(card != NULL && device_data != NULL && ops != NULL, return -ENXIO);
49+
snd_assert(card != NULL, return -ENXIO);
50+
snd_assert(device_data != NULL, return -ENXIO);
51+
snd_assert(ops != NULL, return -ENXIO);
5052
dev = kcalloc(1, sizeof(*dev), GFP_KERNEL);
5153
if (dev == NULL)
5254
return -ENOMEM;
@@ -102,7 +104,7 @@ int snd_device_free(snd_card_t *card, void *device_data)
102104
}
103105

104106
/**
105-
* snd_device_free - disconnect the device
107+
* snd_device_disconnect - disconnect the device
106108
* @card: the card instance
107109
* @device_data: the data pointer to disconnect
108110
*
@@ -118,7 +120,7 @@ int snd_device_disconnect(snd_card_t *card, void *device_data)
118120
{
119121
struct list_head *list;
120122
snd_device_t *dev;
121-
123+
122124
snd_assert(card != NULL, return -ENXIO);
123125
snd_assert(device_data != NULL, return -ENXIO);
124126
list_for_each(list, &card->devices) {
@@ -154,8 +156,9 @@ int snd_device_register(snd_card_t *card, void *device_data)
154156
struct list_head *list;
155157
snd_device_t *dev;
156158
int err;
157-
158-
snd_assert(card != NULL && device_data != NULL, return -ENXIO);
159+
160+
snd_assert(card != NULL, return -ENXIO);
161+
snd_assert(device_data != NULL, return -ENXIO);
159162
list_for_each(list, &card->devices) {
160163
dev = snd_device(list);
161164
if (dev->device_data != device_data)

0 commit comments

Comments
 (0)