staging: pi433: pi433_write fixed the return value
authorOliver Graute <oliver.graute@gmail.com>
Tue, 19 Dec 2017 19:58:31 +0000 (20:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Dec 2017 17:17:05 +0000 (18:17 +0100)
The pi433_write function should return the number of processed bytes

Reported-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
Signed-off-by: Oliver Graute <oliver.graute@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/pi433/pi433_if.c

index 89c03601ec1f291e24666a0676528d7da6cbc20c..1d7c50c1ac23b2fcaaea9a4a8e1e6ee3c646a639 100644 (file)
@@ -837,7 +837,7 @@ pi433_write(struct file *filp, const char __user *buf,
        wake_up_interruptible(&device->tx_wait_queue);
        dev_dbg(device->dev, "write: generated new msg with %d bytes.", copied);
 
-       return 0;
+       return copied;
 
 abort:
        dev_dbg(device->dev, "write to fifo failed: 0x%x", retval);