clk: mediatek: Warn if clk IDs are duplicated
authorChen-Yu Tsai <wenst@chromium.org>
Tue, 8 Feb 2022 12:40:34 +0000 (20:40 +0800)
committerStephen Boyd <sboyd@kernel.org>
Thu, 17 Feb 2022 20:12:25 +0000 (12:12 -0800)
commitd54bb86b89556712d92154a386b421012fecf79e
treeb76779b2ad6518cd92ad106bbac8e1012d157aa5
parentcf8a482afc286dde5eaf4a08d12b63590c599764
clk: mediatek: Warn if clk IDs are duplicated

The Mediatek clk driver library handles duplicate clock IDs in two
different ways: either ignoring the duplicate entry, or overwriting
the old clk. Either way may cause unexpected behavior, and the latter
also causes an orphan clk that cannot be cleaned up.

Align the behavior so that later duplicate entries are ignored, and
a warning printed. The warning will also aid in making the issue
noticeable.

Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220208124034.414635-32-wenst@chromium.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/mediatek/clk-cpumux.c
drivers/clk/mediatek/clk-gate.c
drivers/clk/mediatek/clk-mtk.c
drivers/clk/mediatek/clk-mux.c
drivers/clk/mediatek/clk-pll.c