gpu: nvgpu: add domain name API

Add nvgpu_nvs_domain_get_name() to minimize messing up with nvs
internals and to help code organization when nvs is not built in yet. A
stub to help compilation returns NULL because no domains can exist when
the stub is built in, and thus it won't be used.

Jira NVGPU-6788

Change-Id: If663f7c0e8434ef00dd3a3f40f6404a35b477f2b
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2673120
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Konsta Hölttä
2022-02-23 12:11:20 +02:00
committed by mobile promotions
parent 2a8914619d
commit f10ee4ab0e
3 changed files with 18 additions and 4 deletions

View File

@@ -103,6 +103,7 @@ struct nvgpu_nvs_domain *
nvgpu_nvs_domain_by_name(struct gk20a *g, const char *name);
void nvgpu_nvs_domain_get(struct gk20a *g, struct nvgpu_nvs_domain *dom);
void nvgpu_nvs_domain_put(struct gk20a *g, struct nvgpu_nvs_domain *dom);
const char *nvgpu_nvs_domain_get_name(struct nvgpu_nvs_domain *dom);
/*
* Debug wrapper for NVS code.
*/
@@ -134,6 +135,12 @@ static inline void nvgpu_nvs_domain_put(struct gk20a *g, struct nvgpu_nvs_domain
(void)g;
(void)dom;
}
static inline const char *nvgpu_nvs_domain_get_name(struct nvgpu_nvs_domain *dom)
{
(void)dom;
return NULL;
}
#endif
#endif