diff options
-rw-r--r-- | src/evdev.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/evdev.c b/src/evdev.c index dc3cd89..fc7ba88 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -2354,14 +2354,16 @@ EvdevOpenDevice(InputInfoPtr pInfo) } #ifdef MULTITOUCH - pEvdev->mtdev = mtdev_new_open(pInfo->fd); + if (!pEvdev->mtdev) { /* after PreInit mtdev is still valid */ + pEvdev->mtdev = mtdev_new_open(pInfo->fd); + if (!pEvdev->mtdev) { + xf86Msg(X_ERROR, "%s: Couldn't open mtdev device\n", pInfo->name); + EvdevCloseDevice(pInfo); + return FALSE; + } + } if (pEvdev->mtdev) pEvdev->cur_slot = pEvdev->mtdev->caps.slot.value; - else { - xf86Msg(X_ERROR, "%s: Couldn't open mtdev device\n", pInfo->name); - EvdevCloseDevice(pInfo); - return FALSE; - } #endif /* Check major/minor of device node to avoid adding duplicate devices. */ |