mbox series

[0/2] clk: Add a devm variant of clk_rate_exclusive_get()

Message ID cover.1702403904.git.u.kleine-koenig@pengutronix.de (mailing list archive)
Headers show
Series clk: Add a devm variant of clk_rate_exclusive_get() | expand

Message

Uwe Kleine-König Dec. 12, 2023, 6:09 p.m. UTC
Hello,

patch #1 adds a new function devm_clk_rate_exclusive_get() that
simplifies usage of clk_rate_exclusive_get() in probe functions.

One downside is that a caller of clk_rate_exclusive_get() doesn't need
to check the return value, devm_clk_rate_exclusive_get() can fail
however. So to benefit from the new function you usually need to add a
check for devm_clk_rate_exclusive_get() failing in return to simplifying
error paths in .probe() and .remove().

Patch #2 shows an example conversion. Note that without
devm_clk_rate_exclusive_get() the pwm-xilinx driver cannot benefit from
devm_pwmchip_add().

This series bases on
https://lore.kernel.org/linux-clk/cover.1702400947.git.u.kleine-koenig@pengutronix.de/T/#t
. That's not a "hard" dependency, it can easily be rebased to next.
There is only a trivial context conflict in include/linux/clk.h.

Regarding how to merge this: I suggest to take patch #1 via clk. When
this is merged I will take care for the pwm-xilinx driver (and others
that might benefit).

Best regards
Uwe

Uwe Kleine-König (2):
  clk: Add a devm variant of clk_rate_exclusive_get()
  pwm: xilinx: Simplify using devm functions

 drivers/clk/clk.c        | 15 +++++++++++++++
 drivers/pwm/pwm-xilinx.c | 25 ++++++-------------------
 include/linux/clk.h      | 12 ++++++++++++
 3 files changed, 33 insertions(+), 19 deletions(-)


base-commit: bbd220ce4e29ed55ab079007cff0b550895258eb
prerequisite-patch-id: 5a986d744a054000998ce06e3dbaaedede71c8ac
prerequisite-patch-id: cdb26f72d1fbd7fef4a9ef4476e0218dd3fcba22
prerequisite-patch-id: 838e3cb639cf13c7b571d77c1dea3d4ec479465d
prerequisite-patch-id: d5059c23f752a4861e5bbfe70b8ab771727bf68d
prerequisite-patch-id: c7ca9e00334dabe41f39e006ceb2b7d1afddcaa5