This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: keytable: abi no longer set LIRC_CAN_REC_SCANCODE for raw devices
Author:  Sean Young <s...@mess.org>
Date:    Tue Jan 2 22:07:44 2018 +0000

Simplify the code; we can set LIRC_MODE_SCANCODE for receiving,
and if this fails then the kernel is too old, or the device does
not support receiving (in which case we would not end up in this
code patch anyway).

Signed-off-by: Sean Young <s...@mess.org>
(cherry picked from commit c2b90a15318a1ecd90e81c17e8af552cc9c6ed83)

 utils/keytable/keytable.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=0383064cdfabeeabb08c62a49d1737529c62cd17
diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
index 9a0dc0feeb2d..34a1522e972e 100644
--- a/utils/keytable/keytable.c
+++ b/utils/keytable/keytable.c
@@ -1351,28 +1351,17 @@ static void test_event(struct rc_device *rc_dev, int fd)
        ioctl(fd, EVIOCSCLOCKID, &mode);
 
        if (rc_dev->lirc_name) {
+               unsigned mode = LIRC_MODE_SCANCODE;
                lircfd = open(rc_dev->lirc_name, O_RDONLY | O_NONBLOCK);
                if (lircfd == -1) {
                        perror(_("Can't open lirc device"));
                        return;
                }
-               unsigned features;
-               if (ioctl(lircfd, LIRC_GET_FEATURES, &features)) {
-                       perror(_("Can't get lirc features"));
-                       return;
-               }
-
-               if (!(features & LIRC_CAN_REC_SCANCODE)) {
+               if (ioctl(lircfd, LIRC_SET_REC_MODE, &mode)) {
+                       /* If we can't set scancode mode, kernel is too old */
                        close(lircfd);
                        lircfd = -1;
                }
-               else {
-                       unsigned mode = LIRC_MODE_SCANCODE;
-                       if (ioctl(lircfd, LIRC_SET_REC_MODE, &mode)) {
-                               perror(_("Can't set lirc scancode mode"));
-                               return;
-                       }
-               }
        }
 
        printf (_("Testing events. Please, press CTRL-C to abort.\n"));

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to