Change-Id: I5fc2df8336470fb9e24efbebe819706ae9020031
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <errno.h>
#include <linux/limits.h>
#include <dirent.h>
if (!state)
return -EINVAL;
+ /* Since kernel version 5.4, it doesn't support the node. */
+ if (access(TOUCHSCREEN_CON_FILE, F_OK) != 0)
+ return -ENODEV;
+
ret = sys_get_int(TOUCHSCREEN_CON_FILE, &val);
if (ret < 0) {
_E("Failed to get touchscreen state (%d)", ret);
int ret;
int val;
+ /* Since kernel version 5.4, it doesn't support the node. */
+ if (access(TOUCHSCREEN_CON_FILE, F_OK) != 0)
+ return -ENODEV;
+
switch (state) {
case TOUCHSCREEN_OFF:
val = TURNOFF_TOUCHSCREEN;