linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] iio: Start conversion to sysfs_emit()
@ 2021-03-20  7:14 Lars-Peter Clausen
  2021-03-20  7:14 ` [PATCH 1/4] iio: core: Use sysfs_emit() (trivial bits) Lars-Peter Clausen
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Lars-Peter Clausen @ 2021-03-20  7:14 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Joe Perches, linux-iio, Lars-Peter Clausen

sysfs_emit() and sysfs_emit_at() are new helper functions for output data
for sysfs attributes. They are preferred over raw s*printf() for sysfs
attributes since it knows about the sysfs buffer specifics and has some
built-in sanity checks.

This patch series updates the IIO core to make use these new helper
functions instead of raw s*printf().

In addition all the powerdown callbacks of DAC drivers are also updated to
use sysfs_emit().

There remain many instances of s*printf() in individual drivers for now.
These can be converted in follow up patch series.

But in many cases rather than doing the conversion from s*printf() to
sysfs_emit() it will be better to convert those drivers to implement
read_raw() or read_avail() callbacks and let the IIO core do the
formatting.

Implementing read_raw() or read_avail() instead of directly implementing a
sysfs attribute has the advantage that the data can then also be accessed
through in-kernel APIs and is available to in-kernel consumers.

Lars-Peter Clausen (4):
  iio: core: Use sysfs_emit() (trivial bits)
  iio: iio_enum_available_read(): Convert to sysfs_emit_at()
  iio: __iio_format_value(): Convert to sysfs_emit_at()
  iio: dac: Convert powerdown read callbacks to sysfs_emit()

 drivers/iio/dac/ad5064.c           |  2 +-
 drivers/iio/dac/ad5360.c           |  2 +-
 drivers/iio/dac/ad5380.c           |  2 +-
 drivers/iio/dac/ad5446.c           |  2 +-
 drivers/iio/dac/ad5504.c           |  4 +-
 drivers/iio/dac/ad5624r_spi.c      |  4 +-
 drivers/iio/dac/ad5686.c           |  2 +-
 drivers/iio/dac/ad5755.c           |  4 +-
 drivers/iio/dac/ad5758.c           |  2 +-
 drivers/iio/dac/ad5770r.c          |  2 +-
 drivers/iio/dac/ad5791.c           |  2 +-
 drivers/iio/dac/ad7303.c           |  2 +-
 drivers/iio/dac/ltc2632.c          |  4 +-
 drivers/iio/dac/max5821.c          |  2 +-
 drivers/iio/dac/mcp4725.c          |  2 +-
 drivers/iio/dac/stm32-dac.c        |  2 +-
 drivers/iio/dac/ti-dac082s085.c    |  2 +-
 drivers/iio/dac/ti-dac5571.c       |  2 +-
 drivers/iio/dac/ti-dac7311.c       |  2 +-
 drivers/iio/industrialio-buffer.c  | 20 ++++-----
 drivers/iio/industrialio-core.c    | 70 +++++++++++++++---------------
 drivers/iio/industrialio-event.c   |  2 +-
 drivers/iio/industrialio-trigger.c |  4 +-
 23 files changed, 71 insertions(+), 71 deletions(-)

-- 
2.20.1


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

end of thread, other threads:[~2021-03-29 11:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-20  7:14 [PATCH 0/4] iio: Start conversion to sysfs_emit() Lars-Peter Clausen
2021-03-20  7:14 ` [PATCH 1/4] iio: core: Use sysfs_emit() (trivial bits) Lars-Peter Clausen
2021-03-20  7:14 ` [PATCH 2/4] iio: iio_enum_available_read(): Convert to sysfs_emit_at() Lars-Peter Clausen
2021-03-20  7:14 ` [PATCH 3/4] iio: __iio_format_value(): " Lars-Peter Clausen
2021-03-20  7:14 ` [PATCH 4/4] iio: dac: Convert powerdown read callbacks to sysfs_emit() Lars-Peter Clausen
2021-03-20 11:01   ` Joe Perches
2021-03-20 12:52     ` Lars-Peter Clausen
2021-03-20 15:13       ` Joe Perches
2021-03-29 10:13         ` Jonathan Cameron
2021-03-29 11:21       ` Andy Shevchenko
2021-03-29 11:22         ` Andy Shevchenko
2021-03-29 11:27   ` Andy Shevchenko
2021-03-20 18:34 ` [PATCH 0/4] iio: Start conversion " 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).