From 825f50b1a498f6e3532c8fcbc093322bb386f9e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Tue, 2 Mar 2010 21:30:52 +0200 Subject: [PATCH] OMAP: DSS2: Check if display supports update mode changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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ä Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/display.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c index ef8c8529dda2..480aeaa5f39c 100644 --- a/drivers/video/omap2/dss/display.c +++ b/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) { -- 2.39.5