Skip to content

Commit f76fc5f

Browse files
lkundraklynxeye-dev
authored andcommitted
drm/etnaviv: Don't ignore errors on getting clocks
There might be good reasons why the getting a clock failed. To treat the clocks as optional we're specifically only interested in ignoring -ENOENT, and devm_clk_get_optional() does just that. Note that this preserves the original behavior of all clocks being optional. The binding document mandates the "bus" clock while the dove machine only specifies "core". Signed-off-by: Lubomir Rintel <[email protected]> Signed-off-by: Lucas Stach <[email protected]>
1 parent f8794fe commit f76fc5f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/gpu/drm/etnaviv/etnaviv_gpu.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,26 +1786,26 @@ static int etnaviv_gpu_platform_probe(struct platform_device *pdev)
17861786
}
17871787

17881788
/* Get Clocks: */
1789-
gpu->clk_reg = devm_clk_get(&pdev->dev, "reg");
1789+
gpu->clk_reg = devm_clk_get_optional(&pdev->dev, "reg");
17901790
DBG("clk_reg: %p", gpu->clk_reg);
17911791
if (IS_ERR(gpu->clk_reg))
1792-
gpu->clk_reg = NULL;
1792+
return PTR_ERR(gpu->clk_reg);
17931793

1794-
gpu->clk_bus = devm_clk_get(&pdev->dev, "bus");
1794+
gpu->clk_bus = devm_clk_get_optional(&pdev->dev, "bus");
17951795
DBG("clk_bus: %p", gpu->clk_bus);
17961796
if (IS_ERR(gpu->clk_bus))
1797-
gpu->clk_bus = NULL;
1797+
return PTR_ERR(gpu->clk_bus);
17981798

1799-
gpu->clk_core = devm_clk_get(&pdev->dev, "core");
1799+
gpu->clk_core = devm_clk_get_optional(&pdev->dev, "core");
18001800
DBG("clk_core: %p", gpu->clk_core);
18011801
if (IS_ERR(gpu->clk_core))
1802-
gpu->clk_core = NULL;
1802+
return PTR_ERR(gpu->clk_core);
18031803
gpu->base_rate_core = clk_get_rate(gpu->clk_core);
18041804

1805-
gpu->clk_shader = devm_clk_get(&pdev->dev, "shader");
1805+
gpu->clk_shader = devm_clk_get_optional(&pdev->dev, "shader");
18061806
DBG("clk_shader: %p", gpu->clk_shader);
18071807
if (IS_ERR(gpu->clk_shader))
1808-
gpu->clk_shader = NULL;
1808+
return PTR_ERR(gpu->clk_shader);
18091809
gpu->base_rate_shader = clk_get_rate(gpu->clk_shader);
18101810

18111811
/* TODO: figure out max mapped size */

0 commit comments

Comments
 (0)