mbox series

[0/3] clk: Remove clk_free and better document clk_ops

Message ID 20231216193843.2463779-1-seanga2@gmail.com
Headers show
Series clk: Remove clk_free and better document clk_ops | expand

Message

Sean Anderson Dec. 16, 2023, 7:38 p.m. UTC
This series contains two unrelated changes. They are included together because
they touch the same files and would otherwise conflict. The first change is to
completely remove clk_free. This is because the op it calls (rfree) is
completely unused. I believe the original intent of this op was to allow clock
drivers to free resources allocated in request. However, no clock drivers do
this, so we can remove the function and all its callers.

The second change is to document the expected behavior and return codes of all
clock functions. At the moment, drivers are very inconsistent. I would like to
have some easily-verified expected behavior we can use when reviewing clock
drivers. Existing code is not fixed, but I hope to make some conversions in the
future.


Sean Anderson (3):
  clk: Remove rfree
  treewide: Remove clk_free
  clk: Document clk_ops return codes and behavior

 arch/arm/mach-rockchip/rk3288/rk3288.c        |   2 -
 arch/arm/mach-socfpga/clock_manager_agilex.c  |   2 -
 arch/arm/mach-socfpga/clock_manager_arria10.c |   7 +-
 arch/arm/mach-socfpga/clock_manager_n5x.c     |   2 -
 arch/arm/mach-zynq/clk.c                      |   2 -
 arch/mips/mach-pic32/cpu.c                    |   7 +-
 arch/sandbox/include/asm/clk.h                |   8 --
 board/microchip/pic32mzda/pic32mzda.c         |   2 -
 board/sipeed/maix/maix.c                      |   1 -
 board/synopsys/hsdk/clk-lib.c                 |   2 -
 drivers/clk/aspeed/clk_ast2600.c              |   2 -
 drivers/clk/at91/compat.c                     |  14 +-
 drivers/clk/clk-uclass.c                      |  40 +-----
 drivers/clk/clk-xlnx-clock-wizard.c           |   1 -
 drivers/clk/clk_sandbox.c                     |  12 --
 drivers/clk/clk_sandbox_test.c                |  12 --
 drivers/clk/clk_versaclock.c                  |  12 +-
 drivers/clk/clk_zynq.c                        |   2 -
 drivers/clk/clk_zynqmp.c                      |   2 -
 drivers/clk/imx/clk-imx8.c                    |   2 -
 drivers/clk/mvebu/armada-37xx-periph.c        |   2 -
 drivers/cpu/riscv_cpu.c                       |   2 -
 drivers/dma/bcm6348-iudma.c                   |   2 -
 drivers/gpio/at91_gpio.c                      |   2 -
 drivers/gpio/atmel_pio4.c                     |   2 -
 drivers/gpio/gpio-rcar.c                      |   1 -
 drivers/hwspinlock/stm32_hwspinlock.c         |   6 +-
 drivers/i2c/at91_i2c.c                        |   2 -
 drivers/i2c/designware_i2c.c                  |   2 -
 drivers/i2c/i2c-microchip.c                   |   2 -
 drivers/i2c/npcm_i2c.c                        |   1 -
 drivers/i2c/ocores_i2c.c                      |   2 -
 drivers/i2c/stm32f7_i2c.c                     |   4 +-
 drivers/mailbox/stm32-ipcc.c                  |   7 +-
 drivers/misc/ls2_sfp.c                        |   1 -
 drivers/mmc/arm_pl180_mmci.c                  |   1 -
 drivers/mmc/aspeed_sdhci.c                    |   4 +-
 drivers/mmc/atmel_sdhci.c                     |   2 -
 drivers/mmc/gen_atmel_mci.c                   |  19 +--
 drivers/mmc/msm_sdhci.c                       |   1 -
 drivers/mmc/pic32_sdhci.c                     |   1 -
 drivers/mmc/renesas-sdhi.c                    |  21 +--
 drivers/mmc/snps_dw_mmc.c                     |   8 +-
 drivers/mmc/socfpga_dw_mmc.c                  |   1 -
 drivers/mmc/stm32_sdmmc2.c                    |   4 +-
 drivers/mmc/uniphier-sd.c                     |   1 -
 drivers/mtd/nand/raw/atmel/nand-controller.c  |   4 +-
 drivers/mtd/renesas_rpc_hf.c                  |   1 -
 drivers/net/bcm6348-eth.c                     |   2 -
 drivers/net/bcm6368-eth.c                     |   2 -
 drivers/net/designware.c                      |   1 -
 drivers/net/dwc_eth_qos.c                     |  43 +-----
 drivers/net/dwc_eth_qos_imx.c                 |  21 +--
 drivers/net/dwc_eth_qos_qcom.c                |   1 -
 drivers/net/dwc_eth_qos_rockchip.c            |   6 +-
 drivers/net/sni_ave.c                         |   5 +-
 drivers/net/ti/am65-cpsw-nuss.c               |   1 -
 drivers/phy/bcm6318-usbh-phy.c                |   2 -
 drivers/phy/bcm6348-usbh-phy.c                |   2 -
 drivers/phy/bcm6368-usbh-phy.c                |   4 -
 drivers/phy/meson-axg-mipi-dphy.c             |   1 -
 drivers/phy/meson-g12a-usb3-pcie.c            |   1 -
 drivers/phy/meson-gxl-usb2.c                  |   1 -
 drivers/phy/phy-rcar-gen2.c                   |   1 -
 drivers/phy/phy-rcar-gen3.c                   |   1 -
 drivers/pinctrl/pinctrl-k210.c                |  20 +--
 drivers/power/domain/imx8mp-hsiomix.c         |   4 +-
 drivers/rtc/stm32_rtc.c                       |  16 +--
 drivers/serial/atmel_usart.c                  |   2 -
 drivers/serial/serial_bcm6345.c               |   1 -
 drivers/serial/serial_msm.c                   |   1 -
 drivers/serial/serial_pic32.c                 |   1 -
 drivers/spi/atcspi200_spi.c                   |   1 -
 drivers/spi/atmel-quadspi.c                   |  14 +-
 drivers/spi/atmel_spi.c                       |   2 -
 drivers/spi/bcm63xx_hsspi.c                   |   4 -
 drivers/spi/bcm63xx_spi.c                     |   2 -
 drivers/spi/bcmbca_hsspi.c                    |   4 -
 drivers/spi/cadence_qspi.c                    |   1 -
 drivers/spi/designware_spi.c                  |   5 -
 drivers/spi/meson_spifc_a1.c                  |  10 --
 drivers/spi/mvebu_a3700_spi.c                 |  10 --
 drivers/spi/spi-aspeed-smc.c                  |   1 -
 drivers/spi/stm32_spi.c                       |  19 +--
 drivers/timer/dw-apb-timer.c                  |   2 -
 drivers/timer/ostm_timer.c                    |   2 -
 drivers/usb/dwc3/dwc3-meson-g12a.c            |   4 +-
 drivers/usb/dwc3/dwc3-meson-gxl.c             |   4 +-
 drivers/usb/host/ehci-atmel.c                 |   8 +-
 drivers/usb/host/ohci-da8xx.c                 |   1 -
 drivers/usb/host/xhci-rcar.c                  |   5 +-
 drivers/video/atmel_hlcdfb.c                  |   2 -
 drivers/video/mali_dp.c                       |  11 +-
 drivers/video/rockchip/rk3288_hdmi.c          |   4 +-
 drivers/video/rockchip/rk_edp.c               |   8 +-
 drivers/watchdog/designware_wdt.c             |  18 +--
 drivers/watchdog/meson_gxbb_wdt.c             |   4 +-
 include/clk-uclass.h                          | 123 +++++++++++++++---
 include/clk.h                                 |  31 -----
 test/dm/clk.c                                 |   9 --
 100 files changed, 174 insertions(+), 515 deletions(-)

Comments

Sean Anderson Jan. 30, 2024, 4:37 a.m. UTC | #1
On Sat, 16 Dec 2023 14:38:40 -0500, Sean Anderson wrote:
> This series contains two unrelated changes. They are included together because
> they touch the same files and would otherwise conflict. The first change is to
> completely remove clk_free. This is because the op it calls (rfree) is
> completely unused. I believe the original intent of this op was to allow clock
> drivers to free resources allocated in request. However, no clock drivers do
> this, so we can remove the function and all its callers.
> 
> [...]

Applied, thanks!

[1/3] clk: Remove rfree
      https://source.denx.de/u-boot/custodians/u-boot-clk/-/commit/82719d3f409f
[2/3] treewide: Remove clk_free
      https://source.denx.de/u-boot/custodians/u-boot-clk/-/commit/c9309f40a683
[3/3] clk: Document clk_ops return codes and behavior
      https://source.denx.de/u-boot/custodians/u-boot-clk/-/commit/0bfbb830554f

Best regards,