linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] iio: introduce iio_{claim|release}_direct_mode()
@ 2016-03-01 18:58 Alison Schofield
  2016-03-01 19:02 ` [RFC PATCH 1/2] iio: core: implement iio_{claim|release}_direct_mode() Alison Schofield
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Alison Schofield @ 2016-03-01 18:58 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: jic23, knaack.h, lars, pmeerw, linux-iio, linux-kernel,
	Michael.Hennerich, gregkh, devel

This patchset introduces two helper functions to simplify driver code
requiring the device to be locked in direct mode during execution of a
code path. The staging driver ad7192 is updated to demonstrate usage.

This could be applied to approximately 18 known cases where the driver
is holding the lock in direct mode.  Unknown cases might be those that
should, but don't, hold the lock.

Alternate implementation: Generalize to support a claim on any mode.
Do iio_claim_mode(device,mode) where if the device is in *mode*, it
is guaranteed to stay that way until release is called. I considered
and rejected this option because a) not sure other modes would ever
need to be locked, and b) the semantic improvement is less when it
is generalized.
 
This patchset was inspired by a discussion on linux-iio:
http://www.spinics.net/lists/linux-iio/msg18540.html

Alison Schofield (2):
  iio: core: implement iio_{claim|release}_direct_mode()
  staging: iio: adc7192: use iio_{claim|release}_direct_mode()

 drivers/iio/industrialio-core.c  | 39 +++++++++++++++++++++++++++++++++++++++
 drivers/staging/iio/adc/ad7192.c | 24 +++++++++---------------
 include/linux/iio/iio.h          |  2 ++
 3 files changed, 50 insertions(+), 15 deletions(-)

-- 
2.1.4


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

end of thread, other threads:[~2016-03-12 11:25 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-01 18:58 [RFC PATCH 0/2] iio: introduce iio_{claim|release}_direct_mode() Alison Schofield
2016-03-01 19:02 ` [RFC PATCH 1/2] iio: core: implement iio_{claim|release}_direct_mode() Alison Schofield
2016-03-02 13:28   ` Lars-Peter Clausen
2016-03-05 18:02     ` Jonathan Cameron
2016-03-09 20:06       ` Alison Schofield
2016-03-09 20:23         ` Jonathan Cameron
2016-03-01 19:03 ` [RFC PATCH 2/2] staging: iio: adc7192: use iio_{claim|release}_direct_mode() Alison Schofield
2016-03-09 19:25 ` [RFC PATCH v2 0/2] iio: introduce iio_device_{claim|release}_direct_mode() Alison Schofield
2016-03-09 19:30   ` [RFC PATCH v2 1/2] iio: core: implement iio_device_{claim|release}_direct_mode() Alison Schofield
2016-03-12 11:18     ` Jonathan Cameron
2016-03-09 19:30   ` [RFC PATCH v2 2/2] staging: iio: ad7192: use iio_device_{claim|release}_direct_mode() Alison Schofield
2016-03-12 11:21     ` Jonathan Cameron
2016-03-12 11:25       ` Jonathan Cameron
2016-03-12 11:16   ` [RFC PATCH v2 0/2] iio: introduce iio_device_{claim|release}_direct_mode() 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).