]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
timer: mtk: skip setting parent with dummy fixed-clock
authorChristian Marangi <ansuelsmth@gmail.com>
Sat, 6 Jul 2024 16:13:02 +0000 (18:13 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 18 Jul 2024 13:40:30 +0000 (07:40 -0600)
Skip setting parent with dummy fixed-clock. Upstream linux might declare
an additional clock for the mtk timer and that additional clock might
also be a fixed-clock defined in DT. Setting parent of a dummy fixed-clock
resulta in error hence mtk timer fails to probe.

Skip setting parent to permit correct probe of the mtk timer.

Fixes: d3c3606c5cc6 ("timer: MediaTek: add timer driver for MediaTek SoCs")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
drivers/timer/mtk_timer.c

index 8216c289837375e524e2d38a9cabaeddd5be5573..06deb23eb999910c79dd1e62ff97869c439f5828 100644 (file)
@@ -73,7 +73,8 @@ static int mtk_timer_probe(struct udevice *dev)
                return ret;
 
        ret = clk_get_by_index(dev, 1, &parent);
-       if (!ret) {
+       /* Skip setting the parent with dummy fixed-clock */
+       if (!ret && parent.dev->driver != DM_DRIVER_GET(fixed_clock)) {
                ret = clk_set_parent(&clk, &parent);
                if (ret)
                        return ret;