clk: mediatek: clk-mtk: Introduce clk_mtk_pdev_{probe,remove}()
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Mon, 6 Mar 2023 14:04:51 +0000 (15:04 +0100)
committerStephen Boyd <sboyd@kernel.org>
Mon, 13 Mar 2023 18:50:13 +0000 (11:50 -0700)
commit252091242404aa7cee131a827a04b8e3d9b88daa
treeb94ceeb473585e5f9379a99b35a0e338fb1b24b9
parent4b476b0f45343177c4666cec593dd1acf649bc09
clk: mediatek: clk-mtk: Introduce clk_mtk_pdev_{probe,remove}()

Introduce functions clk_mtk_pdev_probe() and clk_mtk_pdev_remove():
these will be useful to commonize the probe and remove handlers for
multimedia (clk-mtxxxx-mm) drivers as these are registered by the
mtk-mmsys driver instead of having their own devicetree compatible.

In order to do this, the main logic of clk_mtk_simple{probe,remove}()
was moved to new static __clk_mtk_simple_{probe,remove}() functions
that take as parameter a pointer to struct device_node because when
registering the clocks from mtk-mmsys we want to pass a pointer to
the clock driver's parent (which is, obviously, mtk-mmsys) struct
device_node instead.

As for the clock driver's platform data: for the devicetree case, we
keep using the standard match_data mechanism, else we retrieve it
from an id_table.

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