summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-07-19 10:54:59 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-07-19 11:32:27 +1000
commit1bdc3c58e7ad8da51f0aed6711a096bac48b168b (patch)
treea5639bd35b8c63f187fed455076397107725ed33
parentde753ac30874f1c66bdf66d964959cd47c6b81f9 (diff)
Test the device in PreInit and fail if it cannot be opened.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/xf86Elo.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xf86Elo.c b/src/xf86Elo.c
index 4e9296e..2b09bdc 100644
--- a/src/xf86Elo.c
+++ b/src/xf86Elo.c
@@ -945,7 +945,16 @@ xf86EloInit(InputDriverPtr drv,
xf86Msg(X_ERROR, "%s: No Device specified in Elographics module config.\n",
pInfo->name);
return BadValue;
+ } else {
+ pInfo->fd = xf86OpenSerial(pInfo->options);
+ if (pInfo->fd < 0) {
+ xf86Msg(X_ERROR, "%s: Unable to open Elographics touchscreen device %s", pInfo->name, str);
+ return BadValue;
+ }
+ xf86CloseSerial(pInfo->fd);
+ pInfo->fd = -1;
}
+
priv->input_dev = strdup(str);
opt_model = xf86SetStrOption(pInfo->options, "Model", NULL);