[PATCH 3/4] soc: samsung: exynos-chipid: simplify with dev_err_probe

Tudor Ambarus tudor.ambarus at linaro.org
Wed Nov 12 00:48:22 PST 2025


Use dev_err_probe() to make error code handling simpler and to get
the standardized format of the error code ("ENODEV" instead of -19).

Signed-off-by: Tudor Ambarus <tudor.ambarus at linaro.org>
---
 drivers/soc/samsung/exynos-chipid.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/samsung/exynos-chipid.c b/drivers/soc/samsung/exynos-chipid.c
index 3671ed718b933a2dbb9e154202bd3235e3efd758..b5866a324d8ae911a5c99d0290328efdcc072dfd 100644
--- a/drivers/soc/samsung/exynos-chipid.c
+++ b/drivers/soc/samsung/exynos-chipid.c
@@ -143,10 +143,8 @@ static int exynos_chipid_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	soc_dev_attr->soc_id = exynos_product_id_to_soc_id(soc_info.product_id);
-	if (!soc_dev_attr->soc_id) {
-		pr_err("Unknown SoC\n");
-		return -ENODEV;
-	}
+	if (!soc_dev_attr->soc_id)
+		return dev_err_probe(dev, -ENODEV, "Unknown SoC\n");
 
 	/* please note that the actual registration will be deferred */
 	soc_dev = soc_device_register(soc_dev_attr);

-- 
2.51.2.1041.gc1ab5b90ca-goog




More information about the linux-arm-kernel mailing list