[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231011093412.7994-3-kkartik@nvidia.com>
Date: Wed, 11 Oct 2023 15:04:06 +0530
From: Kartik <kkartik@...dia.com>
To: <thierry.reding@...il.com>, <jonathanh@...dia.com>,
<keescook@...omium.org>, <andy@...nel.org>, <akpm@...ux-foundation.org>,
<arnd@...db.de>, <petlozup@...dia.com>, <pshete@...dia.com>,
<kkartik@...dia.com>, <ulf.hansson@...aro.org>, <frank.li@...o.com>,
<robh@...nel.org>, <stefank@...dia.com>, <pdeschrijver@...dia.com>,
<linux-tegra@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-hardening@...r.kernel.org>, <linux-mm@...ck.org>
Subject: [PATCH v4 2/8] soc/tegra: fuse: Use dev_err_probe for probe failures
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@...dia.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
Powered by blists - more mailing lists