Browse Source

OMAP: DSS2: Check if display supports update mode changes

Check whether the display actually has the set_update_mode() function
before calling it. Only the sysfs codepath was broken, the omapfb ioctl
had the necessary protection.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Ville Syrjälä 15 years ago
parent
commit
825f50b1a4
1 changed files with 3 additions and 0 deletions
  1. 3 0
      drivers/video/omap2/dss/display.c

+ 3 - 0
drivers/video/omap2/dss/display.c

@@ -82,6 +82,9 @@ static ssize_t display_upd_mode_store(struct device *dev,
 	int val, r;
 	enum omap_dss_update_mode mode;
 
+	if (!dssdev->driver->set_update_mode)
+		return -EINVAL;
+
 	val = simple_strtoul(buf, NULL, 10);
 
 	switch (val) {