Skip to contentSkip to conversation

thermal/drivers/hisilicon: Use dev_err_probe() helper

PATCH New Yuan Can 1 participant 1 message Sep 21, 2022 Thermal

lore
Share & tools
lore

Yuan Can

author
#0 lore raw

PATCH 1/1 thermal/drivers/hisilicon: Use dev_err_probe() helper

dev_err() can be replace with dev_err_probe() which will check if error code is -EPROBE_DEFER.

---
 drivers/thermal/hisi_thermal.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/thermal/hisi_thermal.c +2 -3
index d6974db7aaf7..e44f4d9ae7b8 100644
@@ -394,9 +394,8 @@ static int hi6220_thermal_probe(struct hisi_thermal_data *data)
 	data->clk = devm_clk_get(dev, "thermal_clk");
 	if (IS_ERR(data->clk)) {
 		ret = PTR_ERR(data->clk);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to get thermal clk: %d\n", ret);
-		return ret;
+		return dev_err_probe(dev, ret,
+				     "failed to get thermal clk: %d\n", ret);
 	}
 
 	data->sensor = devm_kzalloc(dev, sizeof(*data->sensor), GFP_KERNEL);
Signature · 1 line
2.17.1