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>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20251217-soc-imx9-fix-v1-2-0c763c2dbe29@nxp.com>
Date: Wed, 17 Dec 2025 20:42:08 +0800
From: "Peng Fan (OSS)" <peng.fan@....nxp.com>
To: Shawn Guo <shawnguo@...nel.org>, Sascha Hauer <s.hauer@...gutronix.de>, 
 Pengutronix Kernel Team <kernel@...gutronix.de>, 
 Fabio Estevam <festevam@...il.com>
Cc: imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org, 
 linux-kernel@...r.kernel.org, Peng Fan <peng.fan@....com>
Subject: [PATCH 2/3] soc: imx: Use dev_err_probe() for i.MX9

From: Peng Fan <peng.fan@....com>

Use dev_err_probe() to simplify code. No functional changes.

Signed-off-by: Peng Fan <peng.fan@....com>
---
 drivers/soc/imx/soc-imx9.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/soc/imx/soc-imx9.c b/drivers/soc/imx/soc-imx9.c
index 0b1c59c7ddb244549bfeedc47ae6e8d83c20b39b..d9a686299c5f710bb9988c55ed601fc9d9f19229 100644
--- a/drivers/soc/imx/soc-imx9.c
+++ b/drivers/soc/imx/soc-imx9.c
@@ -31,10 +31,8 @@ static int imx9_soc_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	err = of_property_read_string(of_root, "model", &attr->machine);
-	if (err) {
-		pr_err("%s: missing model property: %d\n", __func__, err);
-		return err;
-	}
+	if (err)
+		return dev_err_probe(dev, err, "%s: missing model property\n", __func__);
 
 	attr->family = devm_kasprintf(dev, GFP_KERNEL, "Freescale i.MX");
 
@@ -46,10 +44,8 @@ static int imx9_soc_probe(struct platform_device *pdev)
 	 * res.a3: uid[63:0];
 	 */
 	arm_smccc_smc(IMX_SIP_GET_SOC_INFO, 0, 0, 0, 0, 0, 0, 0, &res);
-	if (res.a0 != SMCCC_RET_SUCCESS) {
-		pr_err("%s: SMC failed: 0x%lx\n", __func__, res.a0);
-		return -EINVAL;
-	}
+	if (res.a0 != SMCCC_RET_SUCCESS)
+		return dev_err_probe(dev, -EINVAL, "%s: SMC failed: 0x%lx\n", __func__, res.a0);
 
 	soc_id = SOC_ID(res.a1);
 	rev_major = SOC_REV_MAJOR(res.a1);
@@ -63,11 +59,9 @@ static int imx9_soc_probe(struct platform_device *pdev)
 	attr->serial_number = devm_kasprintf(dev, GFP_KERNEL, "%016llx%016llx", uid127_64, uid63_0);
 
 	sdev = soc_device_register(attr);
-	if (IS_ERR(sdev)) {
-		err = PTR_ERR(sdev);
-		pr_err("%s failed to register SoC as a device: %d\n", __func__, err);
-		return err;
-	}
+	if (IS_ERR(sdev))
+		return dev_err_probe(dev, PTR_ERR(sdev),
+				     "%s failed to register SoC as a device\n", __func__);
 
 	return 0;
 }

-- 
2.37.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ