Skip to contentSkip to conversation

reset: hisilicon: Use dev_err_probe instead of dev_err

PATCH New Wang Ming 1 participant 1 message Jul 18, 2023 Reset controller framework

lore
Share & tools
lore

Wang Ming

author
#0 lore raw

PATCH v2 1/1 reset: hisilicon: Use dev_err_probe instead of dev_err

The probe process may generate EPROBE_DEFER. In this case, dev_err_probe can still record err information. This helps simplify code and standardize error output.

---
 drivers/reset/hisilicon/reset-hi3660.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/reset/hisilicon/reset-hi3660.c +2 -2
index 965f5ceba7d8..22a9f87b4979 100644
@@ -90,8 +90,8 @@ static int hi3660_reset_probe(struct platform_device *pdev)
 							  "hisi,rst-syscon");
 	}
 	if (IS_ERR(rc->map)) {
-		dev_err(dev, "failed to get hisilicon,rst-syscon\n");
-		return PTR_ERR(rc->map);
+		return dev_err_probe(dev, PTR_ERR(rc->map),
+					"failed to get hisilicon,rst-syscon\n");
 	}
 
 	rc->rst.ops = &hi3660_reset_ops,
Signature · 1 line
2.25.1