[media] rc: transmit on device which does not support it should fail
authorSean Young <sean@mess.org>
Mon, 13 Aug 2012 11:59:49 +0000 (08:59 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 13 Aug 2012 19:19:14 +0000 (16:19 -0300)
Currently write() will return 0 if an IR device does not support sending.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/rc/ir-lirc-codec.c

index 5faba2a2fdd3b87621388c5c8f4254129d4db0ff..d2fd064474aa9df08e46714fc809cfa00be1dd19 100644 (file)
@@ -105,7 +105,7 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
        struct lirc_codec *lirc;
        struct rc_dev *dev;
        unsigned int *txbuf; /* buffer with values to transmit */
-       ssize_t ret = 0;
+       ssize_t ret = -EINVAL;
        size_t count;
 
        lirc = lirc_get_pdata(file);