gpu: nvgpu: Fix build failure in allocator.h

Fix a build failure caused by missing definition for struct device.
Instead of including device.h wrap the debugfs init function with
CONFIG_DEBUG_FS and forward declare struct device. We don't use any
struct device internals here so we only need to let the compiler
know that this type does exist.

Bug 200310575

Change-Id: I1ae45a8f191d920d9b606fefd5029fad84869cff
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1486012
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Alex Waterman
2017-05-19 09:17:29 -07:00
committed by mobile promotions
parent 05388ad24a
commit 9db45cf037
2 changed files with 5 additions and 2 deletions

View File

@@ -201,9 +201,9 @@ void nvgpu_fini_alloc_debug(struct nvgpu_allocator *a)
#endif
}
#ifdef CONFIG_DEBUG_FS
void nvgpu_alloc_debugfs_init(struct device *dev)
{
#ifdef CONFIG_DEBUG_FS
struct gk20a_platform *platform = dev_get_drvdata(dev);
struct dentry *gpu_root = platform->debugfs;
struct gk20a *g = get_gk20a(dev);
@@ -214,5 +214,5 @@ void nvgpu_alloc_debugfs_init(struct device *dev)
debugfs_create_u32("tracing", 0664, g->debugfs_allocators,
&nvgpu_alloc_tracing_on);
#endif
}
#endif

View File

@@ -281,7 +281,10 @@ static inline void nvgpu_alloc_disable_dbg(struct nvgpu_allocator *a)
*/
extern u32 nvgpu_alloc_tracing_on;
#ifdef CONFIG_DEBUG_FS
struct device;
void nvgpu_alloc_debugfs_init(struct device *dev);
#endif
#define nvgpu_alloc_trace_func() \
do { \