From 132390c79e01b3da732bc7b5d9e729b52086ceb6 Mon Sep 17 00:00:00 2001 From: Andy Gross Date: Mon, 5 Mar 2012 10:48:37 -0600 Subject: staging: drm/omap: Disable DMM debugfs for OMAP3 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 Signed-off-by: Rob Clark Signed-off-by: Greg Kroah-Hartman --- drivers/staging/omapdrm/omap_debugfs.c | 15 +++++++-------- drivers/staging/omapdrm/omap_dmm_tiler.h | 6 ++++++ 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'drivers/staging/omapdrm') diff --git a/drivers/staging/omapdrm/omap_debugfs.c b/drivers/staging/omapdrm/omap_debugfs.c index e23f907e5fc6..2f122e00b51d 100644 --- a/drivers/staging/omapdrm/omap_debugfs.c +++ b/drivers/staging/omapdrm/omap_debugfs.c @@ -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 diff --git a/drivers/staging/omapdrm/omap_dmm_tiler.h b/drivers/staging/omapdrm/omap_dmm_tiler.h index f87cb657d683..55ab284b075b 100644 --- a/drivers/staging/omapdrm/omap_dmm_tiler.h +++ b/drivers/staging/omapdrm/omap_dmm_tiler.h @@ -16,6 +16,7 @@ #ifndef OMAP_DMM_TILER_H #define OMAP_DMM_TILER_H +#include #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 -- cgit v1.2.3