[PATCH] staging: pi433: pi433_write fixed the return value

Oliver Graute oliver.graute at gmail.com
Tue Dec 19 19:27:25 UTC 2017


The pi433_write function should return the number of processed bytes.
This fix endless sending if write is invoked from userspace.

Signed-off-by: Oliver Graute <oliver.graute at gmail.com>
---
 drivers/staging/pi433/pi433_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index 1f3ba55..109b9ea 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -845,7 +845,7 @@ static irqreturn_t DIO1_irq_handler(int irq, void *dev_id)
 	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);
-- 
1.9.1



More information about the devel mailing list