Skip to content

Commit

Permalink
dmc-raw: fix errno return code to be negative
Browse files Browse the repository at this point in the history
  • Loading branch information
merge committed Mar 9, 2017
1 parent 349bdb6 commit 9617c7d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions plugins/dmc-raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ int dmc_init_device(struct tsdev *dev)
tcsetattr(fd, TCSANOW, &t);

if (write(fd, "\x55", 1) != 1) {
fprintf(stderr, "dmc: failed to write. Check permissions of the device!\n");
return EINVAL;
fprintf(stderr,
"dmc: failed to write. Check permissions of the device!\n");
return -EINVAL;
}
sleep(1);
if (write(fd, "\x05\x40", 2) != 2) {
Expand All @@ -75,8 +76,9 @@ int dmc_init_device(struct tsdev *dev)
}
return 0;
fail:
fprintf(stderr, "dmc: selected device is not a touchscreen I understand\n");
return EINVAL;
fprintf(stderr,
"dmc: selected device is not a touchscreen I understand\n");
return -EINVAL;
}

static int dmc_read(struct tslib_module_info *inf, struct ts_sample *samp,
Expand Down

0 comments on commit 9617c7d

Please sign in to comment.