staging: drm/omap: Disable DMM debugfs for OMAP3
authorAndy Gross <andy.gross@ti.com>
Mon, 5 Mar 2012 16:48:37 +0000 (10:48 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Mar 2012 21:38:07 +0000 (13:38 -0800)
OMAP3 does not contain a DMM/Tiler block.  As such, we should not
be exposing any DMM debugfs entries on OMAP3 platforms.

Added inline helper function to verify existence of DMM.

Signed-off-by: Andy Gross <andy.gross@ti.com>
Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/omapdrm/omap_debugfs.c
drivers/staging/omapdrm/omap_dmm_tiler.h

index e23f907e5fc6b31c9209513119de34c969e71fcb..2f122e00b51da07ad7c29e7c4f868ad2bb4ce7b7 100644 (file)
@@ -112,12 +112,10 @@ int omap_debugfs_init(struct drm_minor *minor)
                return ret;
        }
 
-       /* TODO: only do this if has_dmm.. but this fxn gets called before
-        * dev_load() so we don't know this yet..
-        */
-       ret = drm_debugfs_create_files(omap_dmm_debugfs_list,
-                       ARRAY_SIZE(omap_dmm_debugfs_list),
-                       minor->debugfs_root, minor);
+       if (dmm_is_available())
+               ret = drm_debugfs_create_files(omap_dmm_debugfs_list,
+                               ARRAY_SIZE(omap_dmm_debugfs_list),
+                               minor->debugfs_root, minor);
 
        if (ret) {
                dev_err(dev->dev, "could not install omap_dmm_debugfs_list\n");
@@ -131,8 +129,9 @@ void omap_debugfs_cleanup(struct drm_minor *minor)
 {
        drm_debugfs_remove_files(omap_debugfs_list,
                        ARRAY_SIZE(omap_debugfs_list), minor);
-       drm_debugfs_remove_files(omap_dmm_debugfs_list,
-                       ARRAY_SIZE(omap_dmm_debugfs_list), minor);
+       if (dmm_is_available())
+               drm_debugfs_remove_files(omap_dmm_debugfs_list,
+                               ARRAY_SIZE(omap_dmm_debugfs_list), minor);
 }
 
 #endif
index f87cb657d683de3f1f54640541fc6b4d8e83275a..55ab284b075bad351ddfde83b3f0e26765b153b9 100644 (file)
@@ -16,6 +16,7 @@
 #ifndef OMAP_DMM_TILER_H
 #define OMAP_DMM_TILER_H
 
+#include <plat/cpu.h>
 #include "omap_drv.h"
 #include "tcm.h"
 
@@ -132,4 +133,9 @@ struct omap_dmm_platform_data {
        int irq;
 };
 
+static inline int dmm_is_available(void)
+{
+       return cpu_is_omap44xx();
+}
+
 #endif