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>
This commit is contained in:
parent
ebfc6de29a
commit
33bbb8a0ec
|
@ -119,7 +119,7 @@ int snd_timer_global_free(struct snd_timer *timer);
|
||||||
int snd_timer_global_register(struct snd_timer *timer);
|
int snd_timer_global_register(struct snd_timer *timer);
|
||||||
|
|
||||||
int snd_timer_open(struct snd_timer_instance **ti, char *owner, struct snd_timer_id *tid, unsigned int slave_id);
|
int snd_timer_open(struct snd_timer_instance **ti, char *owner, struct snd_timer_id *tid, unsigned int slave_id);
|
||||||
int snd_timer_close(struct snd_timer_instance *timeri);
|
void snd_timer_close(struct snd_timer_instance *timeri);
|
||||||
unsigned long snd_timer_resolution(struct snd_timer_instance *timeri);
|
unsigned long snd_timer_resolution(struct snd_timer_instance *timeri);
|
||||||
int snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks);
|
int snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks);
|
||||||
int snd_timer_stop(struct snd_timer_instance *timeri);
|
int snd_timer_stop(struct snd_timer_instance *timeri);
|
||||||
|
|
|
@ -229,8 +229,8 @@ static int snd_timer_check_master(struct snd_timer_instance *master)
|
||||||
return err < 0 ? err : 0;
|
return err < 0 ? err : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int snd_timer_close_locked(struct snd_timer_instance *timeri,
|
static void snd_timer_close_locked(struct snd_timer_instance *timeri,
|
||||||
struct device **card_devp_to_put);
|
struct device **card_devp_to_put);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* open a timer instance
|
* open a timer instance
|
||||||
|
@ -351,8 +351,8 @@ EXPORT_SYMBOL(snd_timer_open);
|
||||||
* close a timer instance
|
* close a timer instance
|
||||||
* call this with register_mutex down.
|
* call this with register_mutex down.
|
||||||
*/
|
*/
|
||||||
static int snd_timer_close_locked(struct snd_timer_instance *timeri,
|
static void snd_timer_close_locked(struct snd_timer_instance *timeri,
|
||||||
struct device **card_devp_to_put)
|
struct device **card_devp_to_put)
|
||||||
{
|
{
|
||||||
struct snd_timer *timer = timeri->timer;
|
struct snd_timer *timer = timeri->timer;
|
||||||
struct snd_timer_instance *slave, *tmp;
|
struct snd_timer_instance *slave, *tmp;
|
||||||
|
@ -414,28 +414,24 @@ static int snd_timer_close_locked(struct snd_timer_instance *timeri,
|
||||||
*card_devp_to_put = &timer->card->card_dev;
|
*card_devp_to_put = &timer->card->card_dev;
|
||||||
module_put(timer->module);
|
module_put(timer->module);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* close a timer instance
|
* close a timer instance
|
||||||
*/
|
*/
|
||||||
int snd_timer_close(struct snd_timer_instance *timeri)
|
void snd_timer_close(struct snd_timer_instance *timeri)
|
||||||
{
|
{
|
||||||
struct device *card_dev_to_put = NULL;
|
struct device *card_dev_to_put = NULL;
|
||||||
int err;
|
|
||||||
|
|
||||||
if (snd_BUG_ON(!timeri))
|
if (snd_BUG_ON(!timeri))
|
||||||
return -ENXIO;
|
return;
|
||||||
|
|
||||||
mutex_lock(®ister_mutex);
|
mutex_lock(®ister_mutex);
|
||||||
err = snd_timer_close_locked(timeri, &card_dev_to_put);
|
snd_timer_close_locked(timeri, &card_dev_to_put);
|
||||||
mutex_unlock(®ister_mutex);
|
mutex_unlock(®ister_mutex);
|
||||||
/* put_device() is called after unlock for avoiding deadlock */
|
/* put_device() is called after unlock for avoiding deadlock */
|
||||||
if (card_dev_to_put)
|
if (card_dev_to_put)
|
||||||
put_device(card_dev_to_put);
|
put_device(card_dev_to_put);
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(snd_timer_close);
|
EXPORT_SYMBOL(snd_timer_close);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue