gpu: nvgpu: make nvgpu_init_mutex return void

Make the nvgpu_init_mutex function return void.
In linux case, this doesn't affect anything since mutex_init
returns void.
For posix, we assert() and die if pthread_mutex_init fails.

This alleviates the need to error inject for _every_
nvgpu_mutex_init function in the driver.

Jira NVGPU-3476

Change-Id: Ibc801116dc82cdfcedcba2c352785f2640b7d54f
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2130538
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Thomas Fleury
2019-06-04 13:38:29 -07:00
committed by mobile promotions
parent c74b89194d
commit 97762279b7
45 changed files with 81 additions and 419 deletions

View File

@@ -435,21 +435,13 @@ static int gk20a_dbg_gpu_do_dev_open(struct inode *inode,
nvgpu_cond_init(&dbg_s->dbg_events.wait_queue);
nvgpu_init_list_node(&dbg_s->ch_list);
err = nvgpu_mutex_init(&dbg_s->ch_list_lock);
if (err)
goto err_free_session;
err = nvgpu_mutex_init(&dbg_s->ioctl_lock);
if (err)
goto err_destroy_lock;
nvgpu_mutex_init(&dbg_s->ch_list_lock);
nvgpu_mutex_init(&dbg_s->ioctl_lock);
dbg_s->dbg_events.events_enabled = false;
dbg_s->dbg_events.num_pending_events = 0;
return 0;
err_destroy_lock:
nvgpu_mutex_destroy(&dbg_s->ch_list_lock);
err_free_session:
nvgpu_kfree(g, dbg_session_linux);
free_ref:
gk20a_put(g);
return err;