* [PATCH] clk: mediatek: reset: Return regmap's error code
@ 2024-07-17 11:58 Fei Shao
2024-07-17 12:51 ` AngeloGioacchino Del Regno
2024-07-29 23:01 ` Stephen Boyd
0 siblings, 2 replies; 3+ messages in thread
From: Fei Shao @ 2024-07-17 11:58 UTC (permalink / raw)
To: AngeloGioacchino Del Regno, Stephen Boyd
Cc: Fei Shao, Matthias Brugger, Michael Turquette, linux-arm-kernel,
linux-clk, linux-kernel, linux-mediatek
device_node_to_regmap() can return different errors, and it's better
practice to pass them to callers.
Clean up the hardcoded -EINVAL and use PTR_ERR(regmap) instead.
Signed-off-by: Fei Shao <fshao@chromium.org>
---
drivers/clk/mediatek/reset.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/mediatek/reset.c b/drivers/clk/mediatek/reset.c
index 290ceda84ce4..f8c0fd031512 100644
--- a/drivers/clk/mediatek/reset.c
+++ b/drivers/clk/mediatek/reset.c
@@ -138,7 +138,7 @@ int mtk_register_reset_controller(struct device_node *np,
regmap = device_node_to_regmap(np);
if (IS_ERR(regmap)) {
pr_err("Cannot find regmap for %pOF: %pe\n", np, regmap);
- return -EINVAL;
+ return PTR_ERR(regmap);
}
data = kzalloc(sizeof(*data), GFP_KERNEL);
@@ -198,7 +198,7 @@ int mtk_register_reset_controller_with_dev(struct device *dev,
regmap = device_node_to_regmap(np);
if (IS_ERR(regmap)) {
dev_err(dev, "Cannot find regmap %pe\n", regmap);
- return -EINVAL;
+ return PTR_ERR(regmap);
}
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
--
2.45.2.993.g49e7a77208-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: mediatek: reset: Return regmap's error code
2024-07-17 11:58 [PATCH] clk: mediatek: reset: Return regmap's error code Fei Shao
@ 2024-07-17 12:51 ` AngeloGioacchino Del Regno
2024-07-29 23:01 ` Stephen Boyd
1 sibling, 0 replies; 3+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-07-17 12:51 UTC (permalink / raw)
To: Fei Shao, Stephen Boyd
Cc: Matthias Brugger, Michael Turquette, linux-arm-kernel, linux-clk,
linux-kernel, linux-mediatek
Il 17/07/24 13:58, Fei Shao ha scritto:
> device_node_to_regmap() can return different errors, and it's better
> practice to pass them to callers.
>
> Clean up the hardcoded -EINVAL and use PTR_ERR(regmap) instead.
>
> Signed-off-by: Fei Shao <fshao@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: mediatek: reset: Return regmap's error code
2024-07-17 11:58 [PATCH] clk: mediatek: reset: Return regmap's error code Fei Shao
2024-07-17 12:51 ` AngeloGioacchino Del Regno
@ 2024-07-29 23:01 ` Stephen Boyd
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2024-07-29 23:01 UTC (permalink / raw)
To: AngeloGioacchino Del Regno, Fei Shao
Cc: Fei Shao, Matthias Brugger, Michael Turquette, linux-arm-kernel,
linux-clk, linux-kernel, linux-mediatek
Quoting Fei Shao (2024-07-17 04:58:52)
> device_node_to_regmap() can return different errors, and it's better
> practice to pass them to callers.
>
> Clean up the hardcoded -EINVAL and use PTR_ERR(regmap) instead.
>
> Signed-off-by: Fei Shao <fshao@chromium.org>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-07-29 23:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-17 11:58 [PATCH] clk: mediatek: reset: Return regmap's error code Fei Shao
2024-07-17 12:51 ` AngeloGioacchino Del Regno
2024-07-29 23:01 ` Stephen Boyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).