From: Kartik <kkartik@nvidia.com>
To: <thierry.reding@gmail.com>, <jonathanh@nvidia.com>,
<keescook@chromium.org>, <andy@kernel.org>,
<akpm@linux-foundation.org>, <arnd@arndb.de>,
<ulf.hansson@linaro.org>, <linus.walleij@linaro.org>,
<kkartik@nvidia.com>, <pshete@nvidia.com>, <petlozup@nvidia.com>,
<frank.li@vivo.com>, <robh@kernel.org>, <stefank@nvidia.com>,
<pdeschrijver@nvidia.com>, <linux-tegra@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-hardening@vger.kernel.org>,
<linux-mm@kvack.org>
Subject: [PATCH v5 2/8] soc/tegra: fuse: Use dev_err_probe for probe failures
Date: Mon, 16 Oct 2023 11:04:05 +0530 [thread overview]
Message-ID: <20231016053411.3380-3-kkartik@nvidia.com> (raw)
In-Reply-To: <20231016053411.3380-1-kkartik@nvidia.com>
Currently, in tegra_fuse_probe() if clock/reset get fails, then the
driver prints an error if the error is not caused by -EPROBE_DEFER.
This can be improved by using dev_err_probe() instead.
So, return dev_err_probe() if clock/reset get fails.
Signed-off-by: Kartik <kkartik@nvidia.com>
---
drivers/soc/tegra/fuse/fuse-tegra.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c
index a2c28f493a75..98805885158e 100644
--- a/drivers/soc/tegra/fuse/fuse-tegra.c
+++ b/drivers/soc/tegra/fuse/fuse-tegra.c
@@ -131,13 +131,8 @@ static int tegra_fuse_probe(struct platform_device *pdev)
fuse->phys = res->start;
fuse->clk = devm_clk_get(&pdev->dev, "fuse");
- if (IS_ERR(fuse->clk)) {
- if (PTR_ERR(fuse->clk) != -EPROBE_DEFER)
- dev_err(&pdev->dev, "failed to get FUSE clock: %ld",
- PTR_ERR(fuse->clk));
-
- return PTR_ERR(fuse->clk);
- }
+ if (IS_ERR(fuse->clk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(fuse->clk), "failed to get FUSE clock\n");
platform_set_drvdata(pdev, fuse);
fuse->dev = &pdev->dev;
@@ -179,12 +174,8 @@ static int tegra_fuse_probe(struct platform_device *pdev)
}
fuse->rst = devm_reset_control_get_optional(&pdev->dev, "fuse");
- if (IS_ERR(fuse->rst)) {
- err = PTR_ERR(fuse->rst);
- dev_err(&pdev->dev, "failed to get FUSE reset: %pe\n",
- fuse->rst);
- return err;
- }
+ if (IS_ERR(fuse->rst))
+ return dev_err_probe(&pdev->dev, PTR_ERR(fuse->rst), "failed to get FUSE reset\n");
/*
* FUSE clock is enabled at a boot time, hence this resume/suspend
--
2.34.1
next prev parent reply other threads:[~2023-10-16 5:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-16 5:34 [PATCH v5 0/8] soc/tegra: fuse: Add ACPI support Kartik
2023-10-16 5:34 ` [PATCH v5 1/8] mm/util: Introduce kmemdup_array() Kartik
2023-10-16 19:49 ` Kees Cook
2023-10-16 5:34 ` Kartik [this message]
2023-10-16 5:34 ` [PATCH v5 3/8] soc/tegra: fuse: Refactor resource mapping Kartik
2023-10-16 5:34 ` [PATCH v5 4/8] soc/tegra: fuse: Add tegra_acpi_init_apbmisc() Kartik
2023-10-16 5:41 ` Christophe JAILLET
2023-10-16 10:15 ` Kartik
2023-10-16 5:34 ` [PATCH v5 5/8] soc/tegra: fuse: Add function to add lookups Kartik
2023-10-16 5:34 ` [PATCH v5 6/8] soc/tegra: fuse: Add function to print SKU info Kartik
2023-10-16 5:34 ` [PATCH v5 7/8] soc/tegra: fuse: Add ACPI support for Tegra194 and Tegra234 Kartik
2023-10-16 5:34 ` [PATCH v5 8/8] soc/tegra: fuse: Add support for Tegra241 Kartik
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=20231016053411.3380-3-kkartik@nvidia.com \
--to=kkartik@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=andy@kernel.org \
--cc=arnd@arndb.de \
--cc=frank.li@vivo.com \
--cc=jonathanh@nvidia.com \
--cc=keescook@chromium.org \
--cc=linus.walleij@linaro.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-tegra@vger.kernel.org \
--cc=pdeschrijver@nvidia.com \
--cc=petlozup@nvidia.com \
--cc=pshete@nvidia.com \
--cc=robh@kernel.org \
--cc=stefank@nvidia.com \
--cc=thierry.reding@gmail.com \
--cc=ulf.hansson@linaro.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