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>
{
struct omap_overlay_manager_info info;
- mgr->get_manager_info(mgr, &info);
+ if(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER))
+ return -ENODEV;
- WARN_ON(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER));
+ mgr->get_manager_info(mgr, &info);
return snprintf(buf, PAGE_SIZE, "%d\n",
info.partial_alpha_enabled);
bool enable;
int r;
- WARN_ON(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER));
+ if(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER))
+ return -ENODEV;
r = strtobool(buf, &enable);
if (r)