From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
To: Krzysztof Kozlowski <krzk@kernel.org>,
Thierry Reding <thierry.reding@kernel.org>,
Jonathan Hunter <jonathanh@nvidia.com>
Cc: linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Subject: [PATCH 3/4] memory: tegra-mc: Simplify printing PTR_ERR with dev_err_probe
Date: Thu, 26 Feb 2026 21:35:26 +0100 [thread overview]
Message-ID: <20260226-memory-simplify-v1-3-ccb94f378628@oss.qualcomm.com> (raw)
In-Reply-To: <20260226-memory-simplify-v1-0-ccb94f378628@oss.qualcomm.com>
Use dev_err_probe() to simplify the code and fix Coccinelle warning:
tegra/mc.c:513:52-59: WARNING: Consider using %pe to print PTR_ERR()
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
drivers/memory/tegra/mc.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index c33f514fc804..1dc516a5be14 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -507,10 +507,9 @@ int tegra30_mc_probe(struct tegra_mc *mc)
int err;
mc->clk = devm_clk_get_optional(mc->dev, "mc");
- if (IS_ERR(mc->clk)) {
- dev_err(mc->dev, "failed to get MC clock: %ld\n", PTR_ERR(mc->clk));
- return PTR_ERR(mc->clk);
- }
+ if (IS_ERR(mc->clk))
+ return dev_err_probe(mc->dev, PTR_ERR(mc->clk),
+ "failed to get MC clock\n");
/* ensure that debug features are disabled */
mc_writel(mc, 0x00000000, MC_TIMING_CONTROL_DBG);
@@ -518,10 +517,8 @@ int tegra30_mc_probe(struct tegra_mc *mc)
tegra_mc_setup_latency_allowance(mc);
err = tegra_mc_setup_timings(mc);
- if (err < 0) {
- dev_err(mc->dev, "failed to setup timings: %d\n", err);
- return err;
- }
+ if (err < 0)
+ return dev_err_probe(mc->dev, err, "failed to setup timings\n");
return 0;
}
--
2.51.0
next prev parent reply other threads:[~2026-02-26 20:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 20:35 [PATCH 0/4] memory: Few code cleanups Krzysztof Kozlowski
2026-02-26 20:35 ` [PATCH 1/4] memory: renesas-rpc-if: Simplify printing PTR_ERR with dev_err_probe Krzysztof Kozlowski
2026-02-26 20:35 ` [PATCH 2/4] memory: tegra-mc: Drop tegra_mc_setup_latency_allowance() return value Krzysztof Kozlowski
2026-02-27 11:55 ` Thierry Reding
2026-02-26 20:35 ` Krzysztof Kozlowski [this message]
2026-02-27 11:56 ` [PATCH 3/4] memory: tegra-mc: Simplify printing PTR_ERR with dev_err_probe Thierry Reding
2026-02-26 20:35 ` [PATCH 4/4] memory: tegra-mc: Use %pe format Krzysztof Kozlowski
2026-02-27 11:56 ` Thierry Reding
2026-03-05 11:57 ` [PATCH 0/4] memory: Few code cleanups Krzysztof Kozlowski
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=20260226-memory-simplify-v1-3-ccb94f378628@oss.qualcomm.com \
--to=krzysztof.kozlowski@oss.qualcomm.com \
--cc=jonathanh@nvidia.com \
--cc=krzk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=thierry.reding@kernel.org \
/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
all inboxes | Powered by JetHome®