linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/19] lirc_dev modernisation
@ 2017-06-25 12:31 David Härdeman
  2017-06-25 12:31 ` [PATCH 01/19] lirc_dev: clarify error handling David Härdeman
                   ` (18 more replies)
  0 siblings, 19 replies; 23+ messages in thread
From: David Härdeman @ 2017-06-25 12:31 UTC (permalink / raw)
  To: linux-media; +Cc: mchehab, sean

This patch series reworks lirc_dev to use a single struct lirc_dev to
keep track of registered lirc devices rather than the current situation
where a combination of a struct lirc_driver and a struct irctl are used.
The fact that two structs are currently used per device makes the current
code harder to read and to analyse (e.g. wrt locking correctness).

The idea started out with this patch:
http://www.mail-archive.com/linux-media@vger.kernel.org/msg112159.html

Which was rejected due to the struct copying. In fixing that issue and
at the same time trying to split up the patch in smaller pieces, I ended
up with quite a bit larger patch series than first expected.

The end result is that struct lirc_dev (which is maintained by lirc_dev)
has proper lifecycle management and that we can avoid the current struct
copying that is performed between struct lirc_driver and struct irctl.

The locking in lirc_dev is also much improved by only having one mutex per
struct lirc_dev which is used to synchronize all operations.

The modifications to lirc_dev and ir-lirc-codec have been tested using
rc-loopback and mceusb. The changes to lirc_zilog are only compile tested.

---

David Härdeman (19):
      lirc_dev: clarify error handling
      lirc_dev: remove support for manually specifying minor number
      lirc_dev: remove min_timeout and max_timeout
      lirc_dev: use cdev_device_add() helper function
      lirc_dev: make better use of file->private_data
      lirc_dev: make chunk_size and buffer_size mandatory
      lirc_dev: remove kmalloc in lirc_dev_fop_read()
      lirc_dev: change irctl->attached to be a boolean
      lirc_dev: sanitize locking
      lirc_dev: use an IDA instead of an array to keep track of registered devices
      lirc_dev: rename struct lirc_driver to struct lirc_dev
      lirc_dev: introduce lirc_allocate_device and lirc_free_device
      lirc_dev: remove the BUFLEN define
      lirc_zilog: add a pointer to the parent device to struct IR
      lirc_zilog: use a dynamically allocated lirc_dev
      lirc_dev: merge struct irctl into struct lirc_dev
      ir-lirc-codec: merge lirc_dev_fop_ioctl into ir_lirc_ioctl
      ir-lirc-codec: move the remaining fops over from lirc_dev
      lirc_dev: consistent device registration printk


 drivers/media/rc/ir-lirc-codec.c        |  404 ++++++++++++++++-----
 drivers/media/rc/lirc_dev.c             |  587 ++++++-------------------------
 drivers/media/rc/rc-core-priv.h         |    2 
 drivers/staging/media/lirc/lirc_zilog.c |  234 +++++-------
 include/media/lirc_dev.h                |  111 ++----
 5 files changed, 570 insertions(+), 768 deletions(-)

--
David Härdeman

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2017-10-09  9:52 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-25 12:31 [PATCH 00/19] lirc_dev modernisation David Härdeman
2017-06-25 12:31 ` [PATCH 01/19] lirc_dev: clarify error handling David Härdeman
2017-06-25 12:31 ` [PATCH 02/19] lirc_dev: remove support for manually specifying minor number David Härdeman
2017-06-25 12:31 ` [PATCH 03/19] lirc_dev: remove min_timeout and max_timeout David Härdeman
2017-06-25 12:31 ` [PATCH 04/19] lirc_dev: use cdev_device_add() helper function David Härdeman
2017-06-25 12:31 ` [PATCH 05/19] lirc_dev: make better use of file->private_data David Härdeman
2017-06-25 12:31 ` [PATCH 06/19] lirc_dev: make chunk_size and buffer_size mandatory David Härdeman
2017-06-25 12:31 ` [PATCH 07/19] lirc_dev: remove kmalloc in lirc_dev_fop_read() David Härdeman
2017-10-04 16:56   ` Mauro Carvalho Chehab
2017-10-09  9:45     ` David Härdeman
2017-06-25 12:31 ` [PATCH 08/19] lirc_dev: change irctl->attached to be a boolean David Härdeman
2017-06-25 12:32 ` [PATCH 09/19] lirc_dev: sanitize locking David Härdeman
2017-06-25 12:32 ` [PATCH 10/19] lirc_dev: use an IDA instead of an array to keep track of registered devices David Härdeman
2017-06-25 12:32 ` [PATCH 11/19] lirc_dev: rename struct lirc_driver to struct lirc_dev David Härdeman
2017-06-25 12:32 ` [PATCH 12/19] lirc_dev: introduce lirc_allocate_device and lirc_free_device David Härdeman
2017-06-25 12:32 ` [PATCH 13/19] lirc_dev: remove the BUFLEN define David Härdeman
2017-06-25 12:32 ` [PATCH 14/19] lirc_zilog: add a pointer to the parent device to struct IR David Härdeman
2017-06-25 12:32 ` [PATCH 15/19] lirc_zilog: use a dynamically allocated lirc_dev David Härdeman
2017-06-25 12:32 ` [PATCH 16/19] lirc_dev: merge struct irctl into struct lirc_dev David Härdeman
2017-06-25 12:32 ` [PATCH 17/19] ir-lirc-codec: merge lirc_dev_fop_ioctl into ir_lirc_ioctl David Härdeman
2017-06-25 12:32 ` [PATCH 18/19] ir-lirc-codec: move the remaining fops over from lirc_dev David Härdeman
2017-06-25 12:32 ` [PATCH 19/19] lirc_dev: consistent device registration printk David Härdeman
2017-08-01 21:20   ` Sean Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).