lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20240830104958.21775-1-chenyufan@vivo.com>
Date: Fri, 30 Aug 2024 18:49:58 +0800
From: Chen Yufan <chenyufan@...o.com>
To: Emilio López <emilio@...pez.com.ar>,
	Michael Turquette <mturquette@...libre.com>,
	Stephen Boyd <sboyd@...nel.org>,
	Chen-Yu Tsai <wens@...e.org>,
	Jernej Skrabec <jernej.skrabec@...il.com>,
	Samuel Holland <samuel@...lland.org>,
	linux-clk@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	linux-sunxi@...ts.linux.dev,
	linux-kernel@...r.kernel.org
Cc: opensource.kernel@...o.com,
	Chen Yufan <chenyufan@...o.com>
Subject: [PATCH v2] clk: sunxi: sun9i-mmc: Use dev_err_probe() to simplfy code

Use dev_err_probe() can make code a bit simpler.

Signed-off-by: Chen Yufan <chenyufan@...o.com>
---
The modifications made compared to the previous version are as follows:
1. Change missing dev_err() to dev_err_probe().
2. Remove the extra "%d" in "dev_err_probe
(&pdev->dev, ret, "Reset deassert err %d\n")".
---
 drivers/clk/sunxi/clk-sun9i-mmc.c | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/drivers/clk/sunxi/clk-sun9i-mmc.c b/drivers/clk/sunxi/clk-sun9i-mmc.c
index 91074017c04f..6e65692dddf3 100644
--- a/drivers/clk/sunxi/clk-sun9i-mmc.c
+++ b/drivers/clk/sunxi/clk-sun9i-mmc.c
@@ -122,22 +122,17 @@ static int sun9i_a80_mmc_config_clk_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	data->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(data->clk)) {
-		dev_err(&pdev->dev, "Could not get clock\n");
-		return PTR_ERR(data->clk);
-	}
+	if (IS_ERR(data->clk))
+		return dev_err_probe(&pdev->dev, PTR_ERR(data->clk), "Could not get clock\n");
 
 	data->reset = devm_reset_control_get_exclusive(&pdev->dev, NULL);
-	if (IS_ERR(data->reset)) {
-		dev_err(&pdev->dev, "Could not get reset control\n");
-		return PTR_ERR(data->reset);
-	}
+	if (IS_ERR(data->reset))
+		return dev_err_probe(&pdev->dev, PTR_ERR(data->reset),
+							 "Could not get reset control\n");
 
 	ret = reset_control_deassert(data->reset);
-	if (ret) {
-		dev_err(&pdev->dev, "Reset deassert err %d\n", ret);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(&pdev->dev, ret, "Reset deassert err\n");
 
 	clk_parent = __clk_get_name(data->clk);
 	for (i = 0; i < count; i++) {
-- 
2.39.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ