linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v8 00/16] clk: provide new devm helpers for prepared and enabled clocks
@ 2022-03-14 14:16 Uwe Kleine-König
  2022-03-14 14:16 ` [PATCH v8 01/16] clk: generalize devm_clk_get() a bit Uwe Kleine-König
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Uwe Kleine-König @ 2022-03-14 14:16 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Russell King, Nuno Sá,
	Jean Delvare, Guenter Roeck, Lars Povlsen, Steen Hegelund,
	UNGLinuxDriver, linux-hwmon, linux-arm-kernel,
	Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Matt Mackall, Herbert Xu, Greg Kroah-Hartman, Linus Walleij,
	Bartosz Golaszewski, Neil Armstrong, David Airlie, Daniel Vetter,
	Kevin Hilman, Jerome Brunet, Martin Blumenstingl, Paul Cercueil,
	Alessandro Zummo, Alexandre Belloni, Wim Van Sebroeck,
	Claudiu Beznea, Thierry Reding, Lee Jones, Nicolas Ferre,
	Oleksij Rempel, Shawn Guo, Fabio Estevam, NXP Linux Team,
	Mark Brown, Vinod Koul
  Cc: linux-clk, kernel, Vladimir Zapolskiy, Heiko Stuebner,
	Tomislav Denis, Anand Ashok Dumbre, Michal Simek,
	André Gustavo Nakagomi Lopez, Cai Huoqing, linux-iio,
	linux-crypto, linux-amlogic, linux-gpio, dri-devel, linux-mips,
	linux-rtc, Keguang Zhang, Andy Gross, Bjorn Andersson,
	Patrice Chotard, Maxime Coquelin, Alexandre Torgue,
	Nobuhiro Iwamatsu, linux-watchdog, linux-arm-msm, linux-stm32,
	linux-pwm, linux-i2c, linux-spi, Amireddy Mallikarjuna reddy,
	dmaengine

Hello,

this is another try to convince the relevant people that
devm_clk_get_enabled() is a nice idea. Compared to v7 (back in May 2021) this
series is rebased to v5.17-rc8 and converts quite some drivers that open code
devm_clk_get_enabled() up to now (patches #3 - #11).

A concern about devm_clk_get_enabled() in v7 was that it helps people to be
lazy and I agree that in some situations when devm_clk_get_enabled() is used it
would be more efficient and sensible to care to only enable the clk when really
needed.

On the other hand, the function is right for some users, e.g. the watchdog
drivers. For the others it's not so simple to judge. Given that there are a
lot of drivers that are lazy even if doing so is some effort (i.e. calling
clk_prepare_enable() and devm_add_action()) convinces me, that introducing the
function family is sensible. (And if you want to work on these drivers,
grepping for devm_clk_get_enabled gives you a few candidates once the
series is in :-)

Otherwise looking at the diffstat of this series:

 48 files changed, 257 insertions(+), 851 deletions(-)

is quite convincing. Just the first two patches (which introduce the new
functions) account for

 2 files changed, 169 insertions(+), 17 deletions(-)

. A rough third of the added lines is documentation. The rest is driver
updates which then has:

 46 files changed, 88 insertions(+), 834 deletions(-)

which makes a really nice cleanup.

The series is build-tested on arm64, m68k, powerpc, riscv, s390, sparc64
and x86_64 using an allmodconfig.

Best regards
Uwe

Uwe Kleine-König (16):
  clk: generalize devm_clk_get() a bit
  clk: Provide new devm_clk helpers for prepared and enabled clocks
  hwmon: Make use of devm_clk_get_enabled()
  iio: Make use of devm_clk_get_enabled()
  hwrng: meson - Don't open-code devm_clk_get_optional_enabled()
  bus: bt1: Don't open code devm_clk_get_enabled()
  gpio: vf610: Simplify error handling in probe
  drm/meson: dw-hdmi: Don't open code devm_clk_get_enabled()
  rtc: ingenic: Simplify using devm_clk_get_enabled()
  clk: meson: axg-audio: Don't duplicate devm_clk_get_enabled()
  watchdog: Make use of devm_clk_get_enabled()
  pwm: atmel: Simplify using devm_clk_get_prepared()
  rtc: at91sam9: Simplify using devm_clk_get_enabled()
  i2c: imx: Simplify using devm_clk_get_enabled()
  spi: davinci: Simplify using devm_clk_get_enabled()
  dmaengine: lgm: Fix error handling

 drivers/bus/bt1-apb.c                 | 23 +------
 drivers/bus/bt1-axi.c                 | 23 +------
 drivers/char/hw_random/meson-rng.c    | 20 +-----
 drivers/clk/clk-devres.c              | 96 ++++++++++++++++++++++-----
 drivers/clk/meson/axg-audio.c         | 36 ++--------
 drivers/dma/lgm/lgm-dma.c             |  8 +--
 drivers/gpio/gpio-vf610.c             | 45 +++----------
 drivers/gpu/drm/meson/meson_dw_hdmi.c | 48 +++++---------
 drivers/hwmon/axi-fan-control.c       | 15 +----
 drivers/hwmon/ltc2947-core.c          | 17 +----
 drivers/hwmon/mr75203.c               | 26 +-------
 drivers/hwmon/sparx5-temp.c           | 19 +-----
 drivers/i2c/busses/i2c-imx.c          | 12 +---
 drivers/iio/adc/ad7124.c              | 15 +----
 drivers/iio/adc/ad7768-1.c            | 17 +----
 drivers/iio/adc/ad9467.c              | 17 +----
 drivers/iio/adc/ingenic-adc.c         | 15 +----
 drivers/iio/adc/lpc18xx_adc.c         | 18 +----
 drivers/iio/adc/rockchip_saradc.c     | 44 +-----------
 drivers/iio/adc/ti-ads131e08.c        | 19 +-----
 drivers/iio/adc/xilinx-ams.c          | 15 +----
 drivers/iio/adc/xilinx-xadc-core.c    | 18 +----
 drivers/iio/frequency/adf4371.c       | 17 +----
 drivers/iio/frequency/admv1013.c      | 15 +----
 drivers/iio/frequency/adrf6780.c      | 16 +----
 drivers/iio/imu/adis16475.c           | 15 +----
 drivers/pwm/pwm-atmel.c               | 16 +----
 drivers/rtc/rtc-at91sam9.c            | 22 ++----
 drivers/rtc/rtc-jz4740.c              | 21 +-----
 drivers/spi/spi-davinci.c             | 11 +--
 drivers/watchdog/cadence_wdt.c        | 17 +----
 drivers/watchdog/davinci_wdt.c        | 18 +----
 drivers/watchdog/imgpdc_wdt.c         | 31 +--------
 drivers/watchdog/imx2_wdt.c           | 15 +----
 drivers/watchdog/imx7ulp_wdt.c        | 15 +----
 drivers/watchdog/loongson1_wdt.c      | 17 +----
 drivers/watchdog/lpc18xx_wdt.c        | 30 +--------
 drivers/watchdog/meson_gxbb_wdt.c     | 16 +----
 drivers/watchdog/of_xilinx_wdt.c      | 16 +----
 drivers/watchdog/pic32-dmt.c          | 15 +----
 drivers/watchdog/pic32-wdt.c          | 17 +----
 drivers/watchdog/pnx4008_wdt.c        | 15 +----
 drivers/watchdog/qcom-wdt.c           | 16 +----
 drivers/watchdog/rtd119x_wdt.c        | 16 +----
 drivers/watchdog/st_lpc_wdt.c         | 16 +----
 drivers/watchdog/stm32_iwdg.c         | 31 +--------
 drivers/watchdog/visconti_wdt.c       | 18 +----
 include/linux/clk.h                   | 90 ++++++++++++++++++++++++-
 48 files changed, 257 insertions(+), 851 deletions(-)


base-commit: 09688c0166e76ce2fb85e86b9d99be8b0084cdf9
-- 
2.35.1


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

end of thread, other threads:[~2022-06-22 15:29 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14 14:16 [PATCH v8 00/16] clk: provide new devm helpers for prepared and enabled clocks Uwe Kleine-König
2022-03-14 14:16 ` [PATCH v8 01/16] clk: generalize devm_clk_get() a bit Uwe Kleine-König
2022-06-21 19:57   ` Jon Hunter
2022-06-21 20:49     ` Uwe Kleine-König
2022-06-22 10:36       ` Andy Shevchenko
2022-06-22 11:14         ` Neil Armstrong
2022-06-22 15:28       ` Jon Hunter
2022-03-14 14:16 ` [PATCH v8 02/16] clk: Provide new devm_clk helpers for prepared and enabled clocks Uwe Kleine-König
2022-03-19 18:29   ` Jonathan Cameron
2022-03-21  7:22     ` Uwe Kleine-König
2022-03-14 14:16 ` [PATCH v8 03/16] hwmon: Make use of devm_clk_get_enabled() Uwe Kleine-König
2022-03-15 23:26   ` Guenter Roeck
2022-03-14 14:16 ` [PATCH v8 05/16] hwrng: meson - Don't open-code devm_clk_get_optional_enabled() Uwe Kleine-König
2022-03-16  8:32   ` Neil Armstrong
2022-03-15 18:03 ` [PATCH v8 00/16] clk: provide new devm helpers for prepared and enabled clocks Andy Shevchenko

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