Skip to content

device property / IIO: Use cleanup.h magic for fwnode_handle_put() handling.

Jonathan Cameron linux-acpi linux-iio 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest15 patches 20 repliesIn review
  2. v315 patches 2 repliesSuperseded
  3. v214 patches 15 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v113 patches10 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15device property: Move fwnode_handle_put() into property.hdrivers/base/property.c include/linux/property.h+13 -152 replies
2/15device property: Add cleanup.h based fwnode_handle_put() scope based cleanup.include/linux/property.h+3 -02 replies
3/15iio: temp: ltc2983: Use __free(fwnode_handle) to replace fwnode_handle_put() callsdrivers/iio/temperature/ltc2983.c+24 -522 replies
4/15device property: Introduce device_for_each_child_node_scoped()include/linux/property.h+5 -02 replies
5/15iio: adc: max11410: Use device_for_each_child_node_scoped()drivers/iio/adc/max11410.c+7 -201 reply
6/15iio: adc: mcp3564: Use device_for_each_child_node_scoped()drivers/iio/adc/mcp3564.c+7 -90 replies
7/15iio: adc: qcom-spmi-adc5: Use device_for_each_child_node_scoped()drivers/iio/adc/qcom-spmi-adc5.c+2 -50 replies
8/15iio: adc: rzg2l_adc: Use device_for_each_child_node_scoped()drivers/iio/adc/rzg2l_adc.c+3 -80 replies
9/15iio: adc: stm32: Use device_for_each_child_node_scoped()drivers/iio/adc/stm32-adc.c+24 -392 replies
10/15iio: adc: ti-ads1015: Use device_for_each_child_node_scoped()drivers/iio/adc/ti-ads1015.c+1 -40 replies
11/15iio: adc: ti-ads131e08: Use device_for_each_child_node_scoped()drivers/iio/adc/ti-ads131e08.c+4 -90 replies
12/15iio: addac: ad74413r: Use device_for_each_child_node_scoped()drivers/iio/addac/ad74413r.c+2 -81 reply
13/15iio: dac: ad3552r: Use device_for_each_child_node_scoped()drivers/iio/dac/ad3552r.c+19 -321 reply
14/15iio: dac: ad5770r: Use device_for_each_child_node_scoped()drivers/iio/dac/ad5770r.c+6 -130 replies
15/15iio: dac: ltc2688: Use device_for_each_child_node_scoped()drivers/iio/dac/ltc2688.c+6 -183 replies

Reviews trailers per patch

7 of 15 patches have a Reviewed-by or Acked-by.

PatchAndy ShevchenkoDmitry BaryshkovGreg Kroah-HartmanNuno SaSakari Ailus
1/15A-b R-b
2/15R-b A-b R-b
3/15
4/15A-b R-b
5/15R-b
6/15
7/15R-b
8/15
9/15
10/15
11/15
12/15R-b
13/15
14/15
15/15R-b T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v4 thread

Cover letter [PATCH v4 00/15] device property / IIO: Use cleanup.h magic for fwnode_handle_put() handling.

From: Jonathan Cameron <[email protected]>

Sorry for the rapid resend, Andy noticed I'd messed up creating the v3 patch set with some updates committed in the wrong patch.

Since v3: The updates to alignment of device_for_each_child_node_scopd() were
in the wrong patch. Move them to patch 4 where they should always have been. (thanks Andy!)

Since v2: Thanks to Sakari and Andy for reviews.
- New first patch moving fwnode_handle_put() into property.h
- Tweak alignment in the loop macro
- Pick up tags.
- scopd -> scoped typo fix in some patch descriptions.

As can be seen by the examples from IIO that follow this can save a reasonable amount of complexity and boiler plate code, often enabling additional cleanups in related code such as use of
return dev_err_probe().

Given we are now fairly late in the cycle, I'd expect to take this through the IIO tree and we can make use of it elsewhere next cycle.

Note I don't have the hardware so this is compile tested only. Hence I'd appreciate some Tested-by tags if anyone can poke one of the effected drivers.

Julia Lawal has posted some nice coccinelle magic for the DT equivalents. Referenced from that cover letter. Similar may help us convert more drivers to use this new approach, but often hand tweaking can take additional advantage of other cleanup.h based magic, or things like return dev_err_probe().
https://lore.kernel.org/all/[email protected]/

Jonathan Cameron (15):
device property: Move fwnode_handle_put() into property.h device property: Add cleanup.h based fwnode_handle_put() scope based
cleanup.
iio: temp: ltc2983: Use __free(fwnode_handle) to replace
fwnode_handle_put() calls
device property: Introduce device_for_each_child_node_scoped()
iio: adc: max11410: Use device_for_each_child_node_scoped()
iio: adc: mcp3564: Use device_for_each_child_node_scoped()
iio: adc: qcom-spmi-adc5: Use device_for_each_child_node_scoped()
iio: adc: rzg2l_adc: Use device_for_each_child_node_scoped()
iio: adc: stm32: Use device_for_each_child_node_scoped()
iio: adc: ti-ads1015: Use device_for_each_child_node_scoped()
iio: adc: ti-ads131e08: Use device_for_each_child_node_scoped()
iio: addac: ad74413r: Use device_for_each_child_node_scoped()
iio: dac: ad3552r: Use device_for_each_child_node_scoped()
iio: dac: ad5770r: Use device_for_each_child_node_scoped()
iio: dac: ltc2688: Use device_for_each_child_node_scoped()

 drivers/base/property.c           | 14 ------
 drivers/iio/adc/max11410.c        | 27 +++--------
 drivers/iio/adc/mcp3564.c         | 16 +++----
 drivers/iio/adc/qcom-spmi-adc5.c  |  7 +--
 drivers/iio/adc/rzg2l_adc.c       | 11 ++---
 drivers/iio/adc/stm32-adc.c       | 63 ++++++++++---------------
 drivers/iio/adc/ti-ads1015.c      |  5 +-
 drivers/iio/adc/ti-ads131e08.c    | 13 ++----
 drivers/iio/addac/ad74413r.c      | 10 +---
 drivers/iio/dac/ad3552r.c         | 51 ++++++++-------------
 drivers/iio/dac/ad5770r.c         | 19 +++-----
 drivers/iio/dac/ltc2688.c         | 24 +++-------
 drivers/iio/temperature/ltc2983.c | 76 ++++++++++---------------------
 include/linux/property.h          | 22 ++++++++-
 14 files changed, 126 insertions(+), 232 deletions(-)
Signature · 1 line
2.43.2