Skip to content

Commit 33bbb8a

Browse files
committed
ALSA: timer: Make snd_timer_close() returning void
The function doesn't return any useful value, so let's make it void to be clearer. Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20191107192008.32331-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent ebfc6de commit 33bbb8a

2 files changed

Lines changed: 8 additions & 12 deletions

File tree

‎include/sound/timer.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ int snd_timer_global_free(struct snd_timer *timer);
119119
int snd_timer_global_register(struct snd_timer *timer);
120120

121121
int snd_timer_open(struct snd_timer_instance **ti, char *owner, struct snd_timer_id *tid, unsigned int slave_id);
122-
int snd_timer_close(struct snd_timer_instance *timeri);
122+
void snd_timer_close(struct snd_timer_instance *timeri);
123123
unsigned long snd_timer_resolution(struct snd_timer_instance *timeri);
124124
int snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks);
125125
int snd_timer_stop(struct snd_timer_instance *timeri);

‎sound/core/timer.c‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ static int snd_timer_check_master(struct snd_timer_instance *master)
229229
return err < 0 ? err : 0;
230230
}
231231

232-
static int snd_timer_close_locked(struct snd_timer_instance *timeri,
233-
struct device **card_devp_to_put);
232+
static void snd_timer_close_locked(struct snd_timer_instance *timeri,
233+
struct device **card_devp_to_put);
234234

235235
/*
236236
* open a timer instance
@@ -351,8 +351,8 @@ EXPORT_SYMBOL(snd_timer_open);
351351
* close a timer instance
352352
* call this with register_mutex down.
353353
*/
354-
static int snd_timer_close_locked(struct snd_timer_instance *timeri,
355-
struct device **card_devp_to_put)
354+
static void snd_timer_close_locked(struct snd_timer_instance *timeri,
355+
struct device **card_devp_to_put)
356356
{
357357
struct snd_timer *timer = timeri->timer;
358358
struct snd_timer_instance *slave, *tmp;
@@ -414,28 +414,24 @@ static int snd_timer_close_locked(struct snd_timer_instance *timeri,
414414
*card_devp_to_put = &timer->card->card_dev;
415415
module_put(timer->module);
416416
}
417-
418-
return 0;
419417
}
420418

421419
/*
422420
* close a timer instance
423421
*/
424-
int snd_timer_close(struct snd_timer_instance *timeri)
422+
void snd_timer_close(struct snd_timer_instance *timeri)
425423
{
426424
struct device *card_dev_to_put = NULL;
427-
int err;
428425

429426
if (snd_BUG_ON(!timeri))
430-
return -ENXIO;
427+
return;
431428

432429
mutex_lock(&register_mutex);
433-
err = snd_timer_close_locked(timeri, &card_dev_to_put);
430+
snd_timer_close_locked(timeri, &card_dev_to_put);
434431
mutex_unlock(&register_mutex);
435432
/* put_device() is called after unlock for avoiding deadlock */
436433
if (card_dev_to_put)
437434
put_device(card_dev_to_put);
438-
return err;
439435
}
440436
EXPORT_SYMBOL(snd_timer_close);
441437

0 commit comments

Comments
 (0)