[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190621162117.22533-3-krzk@kernel.org>
Date: Fri, 21 Jun 2019 18:21:16 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Qiang Yu <yuq825@...il.com>, David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
dri-devel@...ts.freedesktop.org, lima@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Cc: Krzysztof Kozlowski <krzk@...nel.org>
Subject: [PATCH v2 3/4] 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: Krzysztof Kozlowski <krzk@...nel.org>
---
Changes since v1:
1. New patch
---
drivers/gpu/drm/lima/lima_device.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/lima/lima_device.c b/drivers/gpu/drm/lima/lima_device.c
index bb2eaa4f370e..9a6cd879bcb1 100644
--- a/drivers/gpu/drm/lima/lima_device.c
+++ b/drivers/gpu/drm/lima/lima_device.c
@@ -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);
--
2.17.1
Powered by blists - more mailing lists