Skip to content

Add devm_clk_bulk_get_optional_enable() helper and use in AXI Ethernet driver

Suraj Gupta linux-arm-kernel linux-clk lkml netdev 3 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 2 repliesApplied 2/2
  2. v22 patches 1 replySuperseded
  3. v12 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- Correct 'Return' format in documentation of
devm_clk_bulk_get_optional_enable() in patch 1/2.

Patches in v3 All 2 applied

#Subject and filesSizeRepliesApplied
1/2clk: Add devm_clk_bulk_get_optional_enable() helperdrivers/clk/clk-devres.c include/linux/clk.h+73 -02 repliesApplied
2/2net: xilinx: axienet: Use devres for resource management in probe pathdrivers/net/ethernet/xilinx/xilinx_axienet_main.c+27 -560 repliesApplied

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchBrian MasneyStephen Boyd
1/2R-b A-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH V3 0/2] Add devm_clk_bulk_get_optional_enable() helper and use in AXI Ethernet driver

This patch series introduces a new managed clock framework helper function and demonstrates its usage in AXI ethernet driver.

Device drivers frequently need to get optional bulk clocks, prepare them, and enable them during probe, while ensuring automatic cleanup on device unbind. Currently, this requires three separate operations with manual cleanup handling.

The new devm_clk_bulk_get_optional_enable() helper combines these operations into a single managed call, eliminating boilerplate code and following the established pattern of devm_clk_bulk_get_all_enabled().

Changes in V3:
- Correct 'Return' format in documentation of
devm_clk_bulk_get_optional_enable() in patch 1/2.

Changes in V2:
- Modified commit descriptio and subject of patch 2/2

Note:
Prepared this series as per mainline discussion here:
https://lore.kernel.org/all/[email protected]

RFC patch link:
https://lore.kernel.org/all/[email protected]/

Sean Anderson (1):
net: axienet: Fix resource release ordering

Suraj Gupta (1):
clk: Add devm_clk_bulk_get_optional_enable() helper

 drivers/clk/clk-devres.c                      | 50 +++++++++++
 .../net/ethernet/xilinx/xilinx_axienet_main.c | 83 ++++++-------------
 include/linux/clk.h                           | 23 +++++
 3 files changed, 100 insertions(+), 56 deletions(-)
Signature · 1 line
2.25.1