Free mtdev device as well as closing it

mtdev_close_delete() is to mtdev_new_open() as mtdev_close() is to
mtdev_open().  So, since we're using mtdev_new_open(), we need to use
mtdev_close_delete() instead of just mtdev_close() to actually free
everything.

Fixes an eventual failure to open the touchpad device after a lot of
suspend/resume cycles.

[whot: amended to mtdev_close_delete in evdev_query_touch]

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit ce7565ea66)
This commit is contained in:
Daniel Stone
2012-12-29 03:24:52 +00:00
committed by Peter Hutterer
parent 04439c088b
commit 7d1df986e1

View File

@@ -126,7 +126,7 @@ UninitializeTouch(InputInfoPtr pInfo)
proto_data->last_mt_vals = NULL;
}
mtdev_close(proto_data->mtdev);
mtdev_close_delete(proto_data->mtdev);
proto_data->mtdev = NULL;
proto_data->num_touches = 0;
}
@@ -878,7 +878,7 @@ event_query_touch(InputInfoPtr pInfo)
}
out:
mtdev_close(mtdev);
mtdev_close_delete(mtdev);
}
#endif