]> git.baikalelectronics.ru Git - kernel.git/commit
[media] media: rc: raw: improve FIFO handling
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 27 Nov 2015 22:02:38 +0000 (20:02 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 25 Jan 2016 14:38:09 +0000 (12:38 -0200)
commitcf147800616f0a99486877ce7fe7fe05e2faed4f
tree174bde1958c3a549ab9c4fd34187cee2d2762141
parent66810185e87bf46a09883e2bbe9f90c41d7c2691
[media] media: rc: raw: improve FIFO handling

The FIFO is used for ir_raw_event records, however for some historic
reason the FIFO is used on a per byte basis. IMHO this adds unneeded
complexity. Therefore set up the FIFO for ir_raw_event records.

This also allows to define the FIFO statically as part of
ir_raw_event_ctrl instead of having to allocate the FIFO dynamically.
In addition:

- When writing into the FIFO and it's full return ENOSPC instead of
  ENOMEM thus making it easier to tell between "FIFO full" and
  "Dynamic memory allocation failed" when the error is propagated to
  a higher level.
  Also add an error message.

- When reading from the FIFO check whether it's empty.
  This is not strictly needed here but kfifo_out is annotated
  "must check" anyway.

Successfully tested it with the nuvoton-cir driver.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/rc/rc-core-priv.h
drivers/media/rc/rc-ir-raw.c