Skip to content

Commit 3e1a068

Browse files
krzkdlezcano
authored andcommitted
thermal/drivers/hisi: Simplify with dev_err_probe()
Error handling in probe() can be a bit simpler with dev_err_probe(). Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
1 parent ca61766 commit 3e1a068

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

drivers/thermal/hisi_thermal.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -388,15 +388,10 @@ static int hi6220_thermal_probe(struct hisi_thermal_data *data)
388388
{
389389
struct platform_device *pdev = data->pdev;
390390
struct device *dev = &pdev->dev;
391-
int ret;
392391

393392
data->clk = devm_clk_get(dev, "thermal_clk");
394-
if (IS_ERR(data->clk)) {
395-
ret = PTR_ERR(data->clk);
396-
if (ret != -EPROBE_DEFER)
397-
dev_err(dev, "failed to get thermal clk: %d\n", ret);
398-
return ret;
399-
}
393+
if (IS_ERR(data->clk))
394+
return dev_err_probe(dev, PTR_ERR(data->clk), "failed to get thermal clk\n");
400395

401396
data->sensor = devm_kzalloc(dev, sizeof(*data->sensor), GFP_KERNEL);
402397
if (!data->sensor)

0 commit comments

Comments
 (0)