linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/4] Provide devm_clk_bulk_get_all_enabled() helper
@ 2024-10-19 11:15 Cristian Ciocaltea
  2024-10-19 11:16 ` [PATCH v4 1/4] clk: " Cristian Ciocaltea
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Cristian Ciocaltea @ 2024-10-19 11:15 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Russell King, Matthias Brugger,
	AngeloGioacchino Del Regno, Jingoo Han, Lorenzo Pieralisi,
	Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring,
	Bjorn Helgaas, Krzysztof Kozlowski, Alim Akhtar
  Cc: kernel, linux-clk, linux-kernel, linux-arm-kernel, linux-mediatek,
	linux-pci, linux-samsung-soc

Commit 265b07df758a ("clk: Provide managed helper to get and enable bulk
clocks") added devm_clk_bulk_get_all_enable() function, but missed to
return the number of clocks stored in the clk_bulk_data table referenced
by the clks argument.

That is required in case there is a need to iterate these clocks later,
therefore I couldn't see any use case of this parameter and should have
been simply removed from the function declaration.

The first patch in the series provides devm_clk_bulk_get_all_enabled()
variant, which is consistent with devm_clk_bulk_get_all() in terms of
the returned value:

 > 0 if one or more clocks have been stored
 = 0 if there are no clocks
 < 0 if an error occurred

Moreover, the naming is consistent with devm_clk_get_enabled(), i.e. use
the past form of 'enable'.

The next two patches switch existing users of devm_clk_get_enable() to
the new helper - there were only two, as of next-20240913.

The last patch drops the now obsolete devm_clk_bulk_get_all_enable()
helper.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
Changes in v4:
- Dropped usage of gotos in the new helper implementation to further
  minimize the diff (Stephen)
- Link to v3: https://lore.kernel.org/r/20241018-clk_bulk_ena_fix-v3-0-57e8bb82460c@collabora.com

Changes in v3:
- Made devm_clk_bulk_get_all_enable() use the new helper, as suggested
  by Stephen to improve diff readability
- Rebased series onto next-20241017
- Link to v2: https://lore.kernel.org/r/20240926-clk_bulk_ena_fix-v2-0-9c767510fbb5@collabora.com

Changes in v2:
- Dropped references to 'broken' API in commit descriptions, per Mani's
  suggestion
- Added R-b tags from Angelo and Mani
- Link to v1: https://lore.kernel.org/r/20240914-clk_bulk_ena_fix-v1-0-ce3537585c06@collabora.com

---
Cristian Ciocaltea (4):
      clk: Provide devm_clk_bulk_get_all_enabled() helper
      soc: mediatek: pwrap: Switch to devm_clk_bulk_get_all_enabled()
      PCI: exynos: Switch to devm_clk_bulk_get_all_enabled()
      clk: Drop obsolete devm_clk_bulk_get_all_enable() helper

 drivers/clk/clk-devres.c                | 23 ++++++++++++-----------
 drivers/pci/controller/dwc/pci-exynos.c |  2 +-
 drivers/soc/mediatek/mtk-pmic-wrap.c    |  4 ++--
 include/linux/clk.h                     | 12 +++++++-----
 4 files changed, 22 insertions(+), 19 deletions(-)
---
base-commit: f2493655d2d3d5c6958ed996b043c821c23ae8d3
change-id: 20240912-clk_bulk_ena_fix-16ba77358ddf



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

end of thread, other threads:[~2024-10-22 21:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-19 11:15 [PATCH v4 0/4] Provide devm_clk_bulk_get_all_enabled() helper Cristian Ciocaltea
2024-10-19 11:16 ` [PATCH v4 1/4] clk: " Cristian Ciocaltea
2024-10-22 21:05   ` Stephen Boyd
2024-10-19 11:16 ` [PATCH v4 2/4] soc: mediatek: pwrap: Switch to devm_clk_bulk_get_all_enabled() Cristian Ciocaltea
2024-10-19 11:16 ` [PATCH v4 3/4] PCI: exynos: " Cristian Ciocaltea
2024-10-19 11:16 ` [PATCH v4 4/4] clk: Drop obsolete devm_clk_bulk_get_all_enable() helper Cristian Ciocaltea

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