aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-08-27 07:28:03 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-08-29 09:43:47 -0400
commit3825ce5a9bb6ac1f847828ba2b283c9c7aa77eb6 (patch)
treeed4e7148290966da9fe0a24f075f162272accb54 /drivers/video
parentdb680c65156083c8780044f46f7a74544fcb3ce2 (diff)
OMAPDSS: fix WARN_ON in 'alpha_blending_enabled' sysfs file
The code handling 'alpha_blending_enabled' sysfs file contains WARN_ONs in case the feature is not supported on the current platform. Even though only root can write to the file, anyone can read it, thus causing the kernel to get tainted and printing an ugly warning. Instead of having WARN_ONs, return a proper error if the feature is not supported. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reported-by: Russell King - ARM Linux <linux@arm.linux.org.uk>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/manager-sysfs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/video/omap2/dss/manager-sysfs.c b/drivers/video/omap2/dss/manager-sysfs.c
index de7e7b5b1b7c..37b59fe28dc8 100644
--- a/drivers/video/omap2/dss/manager-sysfs.c
+++ b/drivers/video/omap2/dss/manager-sysfs.c
@@ -285,9 +285,10 @@ static ssize_t manager_alpha_blending_enabled_show(
285{ 285{
286 struct omap_overlay_manager_info info; 286 struct omap_overlay_manager_info info;
287 287
288 mgr->get_manager_info(mgr, &info); 288 if(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER))
289 return -ENODEV;
289 290
290 WARN_ON(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)); 291 mgr->get_manager_info(mgr, &info);
291 292
292 return snprintf(buf, PAGE_SIZE, "%d\n", 293 return snprintf(buf, PAGE_SIZE, "%d\n",
293 info.partial_alpha_enabled); 294 info.partial_alpha_enabled);
@@ -301,7 +302,8 @@ static ssize_t manager_alpha_blending_enabled_store(
301 bool enable; 302 bool enable;
302 int r; 303 int r;
303 304
304 WARN_ON(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)); 305 if(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER))
306 return -ENODEV;
305 307
306 r = strtobool(buf, &enable); 308 r = strtobool(buf, &enable);
307 if (r) 309 if (r)