Commit 7b4e467d authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Qiang Yu

drm/lima: Reduce number of PTR_ERR() calls

Store the PTR_ERR() result in local variable in clock init error path.
This makes the code consistent with similar section in regulator init
code.
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarQiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190621162117.22533-3-krzk@kernel.org
parent 34e88f9e
......@@ -83,14 +83,16 @@ static int lima_clk_init(struct lima_device *dev)
dev->clk_bus = devm_clk_get(dev->dev, "bus");
if (IS_ERR(dev->clk_bus)) {
dev_err(dev->dev, "get bus clk failed %ld\n", PTR_ERR(dev->clk_bus));
return PTR_ERR(dev->clk_bus);
err = PTR_ERR(dev->clk_bus);
dev_err(dev->dev, "get bus clk failed %d\n", err);
return err;
}
dev->clk_gpu = devm_clk_get(dev->dev, "core");
if (IS_ERR(dev->clk_gpu)) {
dev_err(dev->dev, "get core clk failed %ld\n", PTR_ERR(dev->clk_gpu));
return PTR_ERR(dev->clk_gpu);
err = PTR_ERR(dev->clk_gpu);
dev_err(dev->dev, "get core clk failed %d\n", err);
return err;
}
err = clk_prepare_enable(dev->clk_bus);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment