]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
clk: meson: migrate meson-aoclk out of hw_onecell_data to drop NR_CLKS
authorNeil Armstrong <neil.armstrong@linaro.org>
Mon, 12 Jun 2023 09:57:20 +0000 (11:57 +0200)
committerJerome Brunet <jbrunet@baylibre.com>
Tue, 8 Aug 2023 14:06:16 +0000 (16:06 +0200)
commit7e1723fd3fa5d75831368e0b3f2e6baac1ac09bb
tree316941849387602441ef2d7611bac23588774894
parent141fbc272b0406265d56db696e8051671dde0bf8
clk: meson: migrate meson-aoclk out of hw_onecell_data to drop NR_CLKS

The way hw_onecell_data is declared:
  struct clk_hw_onecell_data {
          unsigned int num;
          struct clk_hw *hws[];
  };

makes it impossible to have the clk_hw table declared outside while
using ARRAY_SIZE() to determine ".num" due to ".hws" being a flexible
array member.

Completely move out of hw_onecell_data and add a custom
devm_of_clk_add_hw_provider() "get" callback to retrieve the clk_hw
from the meson_aoclk_data struct to finally get rid on the
NR_CLKS define.

[jbrunet: Fixed whitespace checkpatch warning]
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230607-topic-amlogic-upstream-clkid-public-migration-v2-3-38172d17c27a@linaro.org
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
drivers/clk/meson/Kconfig
drivers/clk/meson/axg-aoclk.c
drivers/clk/meson/axg-aoclk.h
drivers/clk/meson/g12a-aoclk.c
drivers/clk/meson/g12a-aoclk.h
drivers/clk/meson/gxbb-aoclk.c
drivers/clk/meson/gxbb-aoclk.h
drivers/clk/meson/meson-aoclk.c
drivers/clk/meson/meson-aoclk.h