public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Qiang Yu <yuq825@gmail.com>, David Airlie <airlied@linux.ie>,
	Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Subject: [PATCH v2 3/4] drm/lima: Reduce number of PTR_ERR() calls
Date: Fri, 21 Jun 2019 18:21:16 +0200	[thread overview]
Message-ID: <20190621162117.22533-3-krzk@kernel.org> (raw)
In-Reply-To: <20190621162117.22533-1-krzk@kernel.org>

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@kernel.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


  parent reply	other threads:[~2019-06-21 16:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21 16:21 [PATCH v2 1/4] drm/lima: Mark 64-bit number as ULL to silence Smatch warning Krzysztof Kozlowski
2019-06-21 16:21 ` [PATCH v2 2/4] drm/lima: Reduce the amount of logs on deferred probe Krzysztof Kozlowski
2019-06-21 16:21 ` Krzysztof Kozlowski [this message]
2019-06-21 16:21 ` [PATCH v2 4/4] drm/lima: Reduce the amount of logs on deferred probe of clocks and reset controller Krzysztof Kozlowski
2019-06-23  2:42 ` [PATCH v2 1/4] drm/lima: Mark 64-bit number as ULL to silence Smatch warning Qiang Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190621162117.22533-3-krzk@kernel.org \
    --to=krzk@kernel.org \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lima@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yuq825@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox