From: Roman Vivchar via B4 Relay <devnull+rva333.protonmail.com@kernel.org>
To: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Flora Fu <flora.fu@mediatek.com>,
Alexandre Mergnat <amergnat@baylibre.com>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org,
Roman Vivchar <rva333@protonmail.com>
Subject: [PATCH 2/3] soc: mediatek: pwrap: use correct log level
Date: Tue, 14 Jul 2026 15:42:04 +0300 [thread overview]
Message-ID: <20260714-6572-pwrap-v1-2-d8e5a39cf7ef@protonmail.com> (raw)
In-Reply-To: <20260714-6572-pwrap-v1-0-d8e5a39cf7ef@protonmail.com>
From: Roman Vivchar <rva333@protonmail.com>
Errors paths should be dev_err, not dev_dbg. Replace all dev_dbg in error
branches to have the correct log level. Also simplify dev_err and return
with dev_err_probe.
Signed-off-by: Roman Vivchar <rva333@protonmail.com>
---
drivers/soc/mediatek/mtk-pmic-wrap.c | 45 ++++++++++++++----------------------
1 file changed, 17 insertions(+), 28 deletions(-)
diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
index 0bcd85826375..a4b10b0a97cb 100644
--- a/drivers/soc/mediatek/mtk-pmic-wrap.c
+++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
@@ -2475,10 +2475,9 @@ static int pwrap_probe(struct platform_device *pdev)
if (np->child)
of_slave_id = of_match_node(of_slave_match_tbl, np->child);
- if (!of_slave_id) {
- dev_dbg(&pdev->dev, "slave pmic should be defined in dts\n");
- return -EINVAL;
- }
+ if (!of_slave_id)
+ return dev_err_probe(&pdev->dev, -EINVAL,
+ "slave pmic should be defined in dts\n");
wrp = devm_kzalloc(&pdev->dev, sizeof(*wrp), GFP_KERNEL);
if (!wrp)
@@ -2496,11 +2495,9 @@ static int pwrap_probe(struct platform_device *pdev)
if (HAS_CAP(wrp->master->caps, PWRAP_CAP_RESET)) {
wrp->rstc = devm_reset_control_get(wrp->dev, "pwrap");
- if (IS_ERR(wrp->rstc)) {
- ret = PTR_ERR(wrp->rstc);
- dev_dbg(wrp->dev, "cannot get pwrap reset: %d\n", ret);
- return ret;
- }
+ if (IS_ERR(wrp->rstc))
+ return dev_err_probe(wrp->dev, PTR_ERR(wrp->rstc),
+ "cannot get pwrap reset\n");
}
if (HAS_CAP(wrp->master->caps, PWRAP_CAP_BRIDGE)) {
@@ -2510,12 +2507,9 @@ static int pwrap_probe(struct platform_device *pdev)
wrp->rstc_bridge = devm_reset_control_get(wrp->dev,
"pwrap-bridge");
- if (IS_ERR(wrp->rstc_bridge)) {
- ret = PTR_ERR(wrp->rstc_bridge);
- dev_dbg(wrp->dev,
- "cannot get pwrap-bridge reset: %d\n", ret);
- return ret;
- }
+ if (IS_ERR(wrp->rstc_bridge))
+ return dev_err_probe(wrp->dev, PTR_ERR(wrp->rstc_bridge),
+ "cannot get pwrap-bridge reset\n");
}
ret = devm_clk_bulk_get_all_enabled(wrp->dev, &clk);
@@ -2535,10 +2529,8 @@ static int pwrap_probe(struct platform_device *pdev)
*/
if (!pwrap_readl(wrp, PWRAP_INIT_DONE2)) {
ret = pwrap_init(wrp);
- if (ret) {
- dev_dbg(wrp->dev, "init failed with %d\n", ret);
- return ret;
- }
+ if (ret)
+ return dev_err_probe(wrp->dev, ret, "init failed\n");
}
if (HAS_CAP(wrp->master->caps, PWRAP_CAP_ARB))
@@ -2548,10 +2540,9 @@ static int pwrap_probe(struct platform_device *pdev)
else
mask_done = PWRAP_STATE_INIT_DONE0;
- if (!(pwrap_readl(wrp, PWRAP_WACS2_RDATA) & mask_done)) {
- dev_dbg(wrp->dev, "initialization isn't finished\n");
- return -ENODEV;
- }
+ if (!(pwrap_readl(wrp, PWRAP_WACS2_RDATA) & mask_done))
+ return dev_err_probe(wrp->dev, -ENODEV,
+ "initialization isn't finished\n");
/* Initialize watchdog, may not be done by the bootloader */
if (!HAS_CAP(wrp->master->caps, PWRAP_CAP_ARB))
@@ -2593,11 +2584,9 @@ static int pwrap_probe(struct platform_device *pdev)
return PTR_ERR(wrp->regmap);
ret = of_platform_populate(np, NULL, NULL, wrp->dev);
- if (ret) {
- dev_dbg(wrp->dev, "failed to create child devices at %pOF\n",
- np);
- return ret;
- }
+ if (ret)
+ return dev_err_probe(wrp->dev, ret,
+ "failed to create child devices at %pOF\n", np);
return 0;
}
--
2.54.0
next prev parent reply other threads:[~2026-07-14 12:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 12:42 [PATCH 0/3] soc: mediatek: pwrap: mt6572 support + log level fixes Roman Vivchar via B4 Relay
2026-07-14 12:42 ` [PATCH 1/3] dt-bindings: soc: mediatek: pwrap: add mt6572 Roman Vivchar via B4 Relay
2026-07-15 10:20 ` AngeloGioacchino Del Regno
2026-07-14 12:42 ` Roman Vivchar via B4 Relay [this message]
2026-07-15 10:20 ` [PATCH 2/3] soc: mediatek: pwrap: use correct log level AngeloGioacchino Del Regno
2026-07-14 12:42 ` [PATCH 3/3] soc: mediatek: pwrap: add mt6572 support Roman Vivchar via B4 Relay
2026-07-15 10:20 ` AngeloGioacchino Del Regno
2026-07-15 11:24 ` Roman Vivchar
2026-07-15 12:01 ` AngeloGioacchino Del Regno
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=20260714-6572-pwrap-v1-2-d8e5a39cf7ef@protonmail.com \
--to=devnull+rva333.protonmail.com@kernel.org \
--cc=amergnat@baylibre.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=flora.fu@mediatek.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=robh@kernel.org \
--cc=rva333@protonmail.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