]> git.ipfire.org Git - thirdparty/u-boot.git/commit
clk: mediatek: refactor parent rate lookup functions
authorDavid Lechner <dlechner@baylibre.com>
Tue, 3 Mar 2026 19:54:50 +0000 (13:54 -0600)
committerDavid Lechner <dlechner@baylibre.com>
Tue, 17 Mar 2026 21:34:35 +0000 (16:34 -0500)
commit00d0ff7f81bfdf341a06fa4b476b669236986d45
tree45954dfb9c4440cc56a2d29c6ff8f1fc497bd2e8
parent5d247265812cd60d5d92c9c7fcc5fd5834c21259
clk: mediatek: refactor parent rate lookup functions

Refactor duplicate parent rate lookup code into a common function.

Instead of relying on rules like X is always the parent of Y, we use
the driver ops pointer to make sure we are actually getting the correct
parent clock device. This allows the same function to be called from
different clock types and will allow future chip-specific clock drivers
to not have to follow the rules as strictly.

Reviewed-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20260303-mtk-mt8189-clocks-v4-2-ee85f8dd2f0d@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
drivers/clk/mediatek/clk-mtk.c