* [PATCH 1/4] memory: renesas-rpc-if: Simplify printing PTR_ERR with dev_err_probe
2026-02-26 20:35 [PATCH 0/4] memory: Few code cleanups Krzysztof Kozlowski
@ 2026-02-26 20:35 ` Krzysztof Kozlowski
2026-02-26 20:35 ` [PATCH 2/4] memory: tegra-mc: Drop tegra_mc_setup_latency_allowance() return value Krzysztof Kozlowski
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-26 20:35 UTC (permalink / raw)
To: Krzysztof Kozlowski, Thierry Reding, Jonathan Hunter
Cc: linux-kernel, linux-tegra, Krzysztof Kozlowski
Use dev_err_probe() to simplify the code and fix Coccinelle warning:
renesas-rpc-if.c:1010:3-10: WARNING: Consider using %pe to print PTR_ERR()
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
drivers/memory/renesas-rpc-if.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c
index 58ccc1c02e90..0fb568456164 100644
--- a/drivers/memory/renesas-rpc-if.c
+++ b/drivers/memory/renesas-rpc-if.c
@@ -1005,11 +1005,9 @@ static int rpcif_probe(struct platform_device *pdev)
return PTR_ERR(rpc->base);
rpc->info = of_device_get_match_data(dev);
rpc->regmap = devm_regmap_init(dev, NULL, rpc, rpc->info->regmap_config);
- if (IS_ERR(rpc->regmap)) {
- dev_err(dev, "failed to init regmap for rpcif, error %ld\n",
- PTR_ERR(rpc->regmap));
- return PTR_ERR(rpc->regmap);
- }
+ if (IS_ERR(rpc->regmap))
+ return dev_err_probe(dev, PTR_ERR(rpc->regmap),
+ "failed to init regmap for rpcif\n");
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dirmap");
rpc->dirmap = devm_ioremap_resource(dev, res);
--
2.51.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH 2/4] memory: tegra-mc: Drop tegra_mc_setup_latency_allowance() return value
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 ` Krzysztof Kozlowski
2026-02-27 11:55 ` Thierry Reding
2026-02-26 20:35 ` [PATCH 3/4] memory: tegra-mc: Simplify printing PTR_ERR with dev_err_probe Krzysztof Kozlowski
` (2 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-26 20:35 UTC (permalink / raw)
To: Krzysztof Kozlowski, Thierry Reding, Jonathan Hunter
Cc: linux-kernel, linux-tegra, Krzysztof Kozlowski
tegra_mc_setup_latency_allowance() only succeeds, thus its return value
can be dropped making code a bit simpler.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
drivers/memory/tegra/mc.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index 6edb210287dc..c33f514fc804 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -386,7 +386,7 @@ EXPORT_SYMBOL_GPL(tegra_mc_get_emem_device_count);
defined(CONFIG_ARCH_TEGRA_124_SOC) || \
defined(CONFIG_ARCH_TEGRA_132_SOC) || \
defined(CONFIG_ARCH_TEGRA_210_SOC)
-static int tegra_mc_setup_latency_allowance(struct tegra_mc *mc)
+static void tegra_mc_setup_latency_allowance(struct tegra_mc *mc)
{
unsigned long long tick;
unsigned int i;
@@ -414,8 +414,6 @@ static int tegra_mc_setup_latency_allowance(struct tegra_mc *mc)
/* latch new values */
mc_writel(mc, MC_TIMING_UPDATE, MC_TIMING_CONTROL);
-
- return 0;
}
static int load_one_timing(struct tegra_mc *mc,
@@ -517,11 +515,7 @@ int tegra30_mc_probe(struct tegra_mc *mc)
/* ensure that debug features are disabled */
mc_writel(mc, 0x00000000, MC_TIMING_CONTROL_DBG);
- err = tegra_mc_setup_latency_allowance(mc);
- if (err < 0) {
- dev_err(mc->dev, "failed to setup latency allowance: %d\n", err);
- return err;
- }
+ tegra_mc_setup_latency_allowance(mc);
err = tegra_mc_setup_timings(mc);
if (err < 0) {
--
2.51.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 2/4] memory: tegra-mc: Drop tegra_mc_setup_latency_allowance() return value
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
0 siblings, 0 replies; 9+ messages in thread
From: Thierry Reding @ 2026-02-27 11:55 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Krzysztof Kozlowski, Jonathan Hunter, linux-kernel, linux-tegra
[-- Attachment #1: Type: text/plain, Size: 425 bytes --]
On Thu, Feb 26, 2026 at 09:35:25PM +0100, Krzysztof Kozlowski wrote:
> tegra_mc_setup_latency_allowance() only succeeds, thus its return value
> can be dropped making code a bit simpler.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
> drivers/memory/tegra/mc.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
Acked-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/4] memory: tegra-mc: Simplify printing PTR_ERR with dev_err_probe
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-26 20:35 ` Krzysztof Kozlowski
2026-02-27 11:56 ` Thierry Reding
2026-02-26 20:35 ` [PATCH 4/4] memory: tegra-mc: Use %pe format Krzysztof Kozlowski
2026-03-05 11:57 ` [PATCH 0/4] memory: Few code cleanups Krzysztof Kozlowski
4 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-26 20:35 UTC (permalink / raw)
To: Krzysztof Kozlowski, Thierry Reding, Jonathan Hunter
Cc: linux-kernel, linux-tegra, Krzysztof Kozlowski
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
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 3/4] memory: tegra-mc: Simplify printing PTR_ERR with dev_err_probe
2026-02-26 20:35 ` [PATCH 3/4] memory: tegra-mc: Simplify printing PTR_ERR with dev_err_probe Krzysztof Kozlowski
@ 2026-02-27 11:56 ` Thierry Reding
0 siblings, 0 replies; 9+ messages in thread
From: Thierry Reding @ 2026-02-27 11:56 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Krzysztof Kozlowski, Jonathan Hunter, linux-kernel, linux-tegra
[-- Attachment #1: Type: text/plain, Size: 458 bytes --]
On Thu, Feb 26, 2026 at 09:35:26PM +0100, Krzysztof Kozlowski wrote:
> 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(-)
Acked-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 4/4] memory: tegra-mc: Use %pe format
2026-02-26 20:35 [PATCH 0/4] memory: Few code cleanups Krzysztof Kozlowski
` (2 preceding siblings ...)
2026-02-26 20:35 ` [PATCH 3/4] memory: tegra-mc: Simplify printing PTR_ERR with dev_err_probe Krzysztof Kozlowski
@ 2026-02-26 20:35 ` Krzysztof Kozlowski
2026-02-27 11:56 ` Thierry Reding
2026-03-05 11:57 ` [PATCH 0/4] memory: Few code cleanups Krzysztof Kozlowski
4 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-26 20:35 UTC (permalink / raw)
To: Krzysztof Kozlowski, Thierry Reding, Jonathan Hunter
Cc: linux-kernel, linux-tegra, Krzysztof Kozlowski
Make code printing pointer error value a bit simpler and fix coccinelle
suggestion:
tegra/mc.c:975:4-11: WARNING: Consider using %pe to print PTR_ERR()
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
drivers/memory/tegra/mc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index 1dc516a5be14..67a0b0c07712 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -962,8 +962,7 @@ static int tegra_mc_probe(struct platform_device *pdev)
if (IS_ENABLED(CONFIG_TEGRA_IOMMU_SMMU) && mc->soc->smmu) {
mc->smmu = tegra_smmu_probe(&pdev->dev, mc->soc->smmu, mc);
if (IS_ERR(mc->smmu)) {
- dev_err(&pdev->dev, "failed to probe SMMU: %ld\n",
- PTR_ERR(mc->smmu));
+ dev_err(&pdev->dev, "failed to probe SMMU: %pe\n", mc->smmu);
mc->smmu = NULL;
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH 4/4] memory: tegra-mc: Use %pe format
2026-02-26 20:35 ` [PATCH 4/4] memory: tegra-mc: Use %pe format Krzysztof Kozlowski
@ 2026-02-27 11:56 ` Thierry Reding
0 siblings, 0 replies; 9+ messages in thread
From: Thierry Reding @ 2026-02-27 11:56 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Krzysztof Kozlowski, Jonathan Hunter, linux-kernel, linux-tegra
[-- Attachment #1: Type: text/plain, Size: 463 bytes --]
On Thu, Feb 26, 2026 at 09:35:27PM +0100, Krzysztof Kozlowski wrote:
> Make code printing pointer error value a bit simpler and fix coccinelle
> suggestion:
>
> tegra/mc.c:975:4-11: WARNING: Consider using %pe to print PTR_ERR()
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
> drivers/memory/tegra/mc.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Acked-by: Thierry Reding <treding@nvidia.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/4] memory: Few code cleanups
2026-02-26 20:35 [PATCH 0/4] memory: Few code cleanups Krzysztof Kozlowski
` (3 preceding siblings ...)
2026-02-26 20:35 ` [PATCH 4/4] memory: tegra-mc: Use %pe format Krzysztof Kozlowski
@ 2026-03-05 11:57 ` Krzysztof Kozlowski
4 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2026-03-05 11:57 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Krzysztof Kozlowski
Cc: linux-kernel, linux-tegra
On Thu, 26 Feb 2026 21:35:23 +0100, Krzysztof Kozlowski wrote:
> Few cleanups for Renesas and Tegra.
>
> Best regards,
> Krzysztof
>
Applied, thanks!
[1/4] memory: renesas-rpc-if: Simplify printing PTR_ERR with dev_err_probe
https://git.kernel.org/krzk/linux-mem-ctrl/c/8a39b1d4b358f8ccae29166e239f4dd2594b2e7c
[2/4] memory: tegra-mc: Drop tegra_mc_setup_latency_allowance() return value
https://git.kernel.org/krzk/linux-mem-ctrl/c/2ac5ba4c50be535497dc01089e4113185e4ccad1
[3/4] memory: tegra-mc: Simplify printing PTR_ERR with dev_err_probe
https://git.kernel.org/krzk/linux-mem-ctrl/c/f7bd985ad907ed85999f4bac4870abe35dcd2745
[4/4] memory: tegra-mc: Use %pe format
https://git.kernel.org/krzk/linux-mem-ctrl/c/2413283fac5b2975f5ead6a1dcac7d5c6f7366d8
Best regards,
--
Krzysztof Kozlowski <krzk@kernel.org>
^ permalink raw reply [flat|nested] 9+ messages in thread