drm: Implement dummies for debugfs helpers
authorThierry Reding <thierry.reding@gmail.com>
Thu, 12 Dec 2013 14:44:04 +0000 (15:44 +0100)
committerDave Airlie <airlied@redhat.com>
Wed, 18 Dec 2013 00:58:11 +0000 (10:58 +1000)
In case where debugfs support is disabled, define dummy functions to
avoid the need for #ifdefery in drivers.

Based on an earlier patch by Arnd Bergmann.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
include/drm/drmP.h

index bc07c7af0f6e4437bc16ce3c6514c6b7b5af1781..8f916d03a6384a966b540486b0e23841f815f21e 100644 (file)
@@ -1478,6 +1478,30 @@ extern int drm_debugfs_create_files(const struct drm_info_list *files,
 extern int drm_debugfs_remove_files(const struct drm_info_list *files,
                                    int count, struct drm_minor *minor);
 extern int drm_debugfs_cleanup(struct drm_minor *minor);
+#else
+static inline int drm_debugfs_init(struct drm_minor *minor, int minor_id,
+                                  struct dentry *root)
+{
+       return 0;
+}
+
+static inline int drm_debugfs_create_files(const struct drm_info_list *files,
+                                          int count, struct dentry *root,
+                                          struct drm_minor *minor)
+{
+       return 0;
+}
+
+static inline int drm_debugfs_remove_files(const struct drm_info_list *files,
+                                          int count, struct drm_minor *minor)
+{
+       return 0;
+}
+
+static inline int drm_debugfs_cleanup(struct drm_minor *minor)
+{
+       return 0;
+}
 #endif
 
                                /* Info file support */