drm/msm: fix building without debugfs
authorArnd Bergmann <arnd@arndb.de>
Mon, 26 Feb 2018 09:49:26 +0000 (10:49 +0100)
committerRob Clark <robdclark@gmail.com>
Mon, 19 Mar 2018 10:33:39 +0000 (06:33 -0400)
The adreno driver stopped building when CONFIG_DEBUGFS is disabled:

drivers/gpu/drm/msm/adreno/adreno_device.c: In function 'adreno_load_gpu':
drivers/gpu/drm/msm/adreno/adreno_device.c:153:16: error: 'const struct msm_gpu_funcs' has no member named 'debugfs_init'
  if (gpu->funcs->debugfs_init) {
                ^~
drivers/gpu/drm/msm/adreno/adreno_device.c:154:13: error: 'const struct msm_gpu_funcs' has no member named 'debugfs_init'
   gpu->funcs->debugfs_init(gpu, dev->primary);
             ^~

This adds an #ifdef around the code that references the hidden
pointer.

Fixes: 331dc0bc195b ("drm/msm: add a5xx specific debugfs")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/msm/adreno/adreno_device.c

index f07d3ec7d77b64f1462dd6eea4fcfb8e2337c4e5..8e0cb161754b994eaef2dc73a98fef9c620872f1 100644 (file)
@@ -164,11 +164,13 @@ struct msm_gpu *adreno_load_gpu(struct drm_device *dev)
                return NULL;
        }
 
+#ifdef CONFIG_DEBUG_FS
        if (gpu->funcs->debugfs_init) {
                gpu->funcs->debugfs_init(gpu, dev->primary);
                gpu->funcs->debugfs_init(gpu, dev->render);
                gpu->funcs->debugfs_init(gpu, dev->control);
        }
+#endif
 
        return gpu;
 }