v3d_drv: Allow clock retrieval by name
authorpopcornmix <popcornmix@gmail.com>
Mon, 9 Sep 2019 22:50:44 +0000 (23:50 +0100)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:33:10 +0000 (16:33 +0100)
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
drivers/gpu/drm/v3d/v3d_drv.c

index 8b08ad8..2f50268 100644 (file)
@@ -285,7 +285,9 @@ static int v3d_platform_drm_probe(struct platform_device *pdev)
                }
        }
 
-       v3d->clk = devm_clk_get(dev, NULL);
+       v3d->clk = devm_clk_get(dev, "v3d");
+       if (!v3d->clk)
+               v3d->clk = devm_clk_get(dev, NULL);
        if (IS_ERR_OR_NULL(v3d->clk)) {
                if (PTR_ERR(v3d->clk) != -EPROBE_DEFER)
                        dev_err(dev, "Failed to get clock (%ld)\n", PTR_ERR(v3d->clk));