clk: meson: migrate axg-audio out of hw_onecell_data to drop NR_CLKS
authorNeil Armstrong <neil.armstrong@linaro.org>
Mon, 12 Jun 2023 09:57:23 +0000 (11:57 +0200)
committerJerome Brunet <jbrunet@baylibre.com>
Tue, 8 Aug 2023 14:06:16 +0000 (16:06 +0200)
commit05d3b7c68e6205b2036a7c854e94a62556eeee0f
tree8234805c744b0669c469f75413c3048aafac36de
parent5e4e480466e611f5febb0e68b1328bfdef6c200e
clk: meson: migrate axg-audio 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
in order to finally get rid on the NR_CLKS define.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230607-topic-amlogic-upstream-clkid-public-migration-v2-6-38172d17c27a@linaro.org
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
drivers/clk/meson/Kconfig
drivers/clk/meson/axg-audio.c
drivers/clk/meson/axg-audio.h