linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/6] iio: core,buffer: re-organize chardev creation
@ 2020-04-26  7:38 Alexandru Ardelean
  2020-04-26  7:38 ` [PATCH v5 1/6] iio: buffer: add back-ref from iio_buffer to iio_dev Alexandru Ardelean
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Alexandru Ardelean @ 2020-04-26  7:38 UTC (permalink / raw)
  To: linux-iio, linux-kernel; +Cc: lars, jic23, pmeerw, Alexandru Ardelean

The main intent is to be able to add more chardevs per IIO device, one
for each buffer. To get there, some rework is needed.
This tries to re-organize the init of the chardev.

Changelog v4 -> v5:
- dropped patch 'iio: Use an early return in iio_device_alloc to simplify code.'
  is applied upstream

Changelog v3 -> v4:
- added patch [1] 'iio: Use an early return in iio_device_alloc to simplify code.'
  it's main purpose is so that this patch applies:
     [2]'iio: core: add simple centralized mechanism for ioctl() handlers'
  depending on the final version of patch [1], patch [2] needs some
  minor fixup
- added patch 'iio: core,buffer: wrap iio_buffer_put() call into iio_buffers_put()'
- patch 'iio: core: register buffer fileops only if buffer present'
  is now: 'iio: core: register chardev only if needed'
- dropped 'iio: buffer: move sysfs alloc/free in industrialio-buffer.c'
  it's likely we won't be doing this patch anymore
- patches:
    'iio: buffer: move iio buffer chrdev in industrialio-buffer.c'
    'iio: event: move event-only chardev in industrialio-event.c'
  have been merged into 'iio: buffer,event: duplicate chardev creation for buffers & events'
  since now, the logic is a bit different, and 'indio_dev->chrdev' is
  now a reference to either the buffer's chrdev & or the events-only
  chrdev
- added simple mechanism to register ioctl() handlers for IIO device
  which is currently used only by events mechanism

Changelog v2 -> v3:
* removed double init in
  'iio: event: move event-only chardev in industrialio-event.c'

Changelog v1 -> v2:
* re-reviewed some exit-paths and cleanup some potential leaks on those
  exit paths:
  - for 'iio: buffer: move iio buffer chrdev in industrialio-buffer.c'
    add iio_device_buffers_put() helper and calling iio_buffers_uninit()
    on device un-regsiter
  - for 'move sysfs alloc/free in industrialio-buffer.c'
    call 'iio_buffer_free_sysfs_and_mask()' on exit path if
    cdev_device_add() fails
  - for 'move event-only chardev in industrialio-event.c'
    check if event_interface is NULL in
    iio_device_unregister_event_chrdev()

Alexandru Ardelean (6):
  iio: buffer: add back-ref from iio_buffer to iio_dev
  iio: core,buffer: wrap iio_buffer_put() call into iio_buffers_put()
  iio: core: register chardev only if needed
  iio: buffer,event: duplicate chardev creation for buffers & events
  iio: core: add simple centralized mechanism for ioctl() handlers
  iio: core: use new common ioctl() mechanism

 drivers/iio/iio_core.h            |  29 ++++++---
 drivers/iio/industrialio-buffer.c | 102 +++++++++++++++++++++++++++--
 drivers/iio/industrialio-core.c   | 105 +++++++++++-------------------
 drivers/iio/industrialio-event.c  | 100 +++++++++++++++++++++++++++-
 include/linux/iio/buffer_impl.h   |  10 +++
 include/linux/iio/iio.h           |   8 +--
 6 files changed, 267 insertions(+), 87 deletions(-)

-- 
2.17.1


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

end of thread, other threads:[~2020-04-27 10:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-26  7:38 [PATCH v5 0/6] iio: core,buffer: re-organize chardev creation Alexandru Ardelean
2020-04-26  7:38 ` [PATCH v5 1/6] iio: buffer: add back-ref from iio_buffer to iio_dev Alexandru Ardelean
2020-04-26  7:38 ` [PATCH v5 2/6] iio: core,buffer: wrap iio_buffer_put() call into iio_buffers_put() Alexandru Ardelean
2020-04-26  7:38 ` [PATCH v5 3/6] iio: core: register chardev only if needed Alexandru Ardelean
2020-04-26  7:38 ` [PATCH v5 4/6] iio: buffer,event: duplicate chardev creation for buffers & events Alexandru Ardelean
2020-04-26 10:00   ` Jonathan Cameron
2020-04-27  6:38     ` Ardelean, Alexandru
2020-04-26  7:38 ` [PATCH v5 5/6] iio: core: add simple centralized mechanism for ioctl() handlers Alexandru Ardelean
2020-04-26 10:10   ` Jonathan Cameron
2020-04-26 10:21     ` Jonathan Cameron
2020-04-27  6:43       ` Ardelean, Alexandru
2020-04-27 10:04         ` Ardelean, Alexandru
2020-04-26  7:38 ` [PATCH v5 6/6] iio: core: use new common ioctl() mechanism Alexandru Ardelean
2020-04-26 10:13   ` Jonathan Cameron

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).