Skip to content

Commit 03c7aea

Browse files
AngeloGioacchino Del RegnoChun-Kuang Hu
authored andcommitted
drm/mediatek: mtk_hdmi: Use dev_err_probe() in mtk_hdmi_dt_parse_pdata()
Change error prints to use dev_err_probe() instead of dev_err() where possible in function mtk_hdmi_dt_parse_pdata(), used only during device probe. While at it, also beautify some prints. Reviewed-by: CK Hu <[email protected]> Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Link: https://patchwork.kernel.org/project/dri-devel/patch/[email protected]/ Signed-off-by: Chun-Kuang Hu <[email protected]>
1 parent 7837702 commit 03c7aea

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

drivers/gpu/drm/mediatek/mtk_hdmi.c

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,19 +1368,13 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
13681368
int ret;
13691369

13701370
ret = mtk_hdmi_get_all_clk(hdmi, np);
1371-
if (ret) {
1372-
if (ret != -EPROBE_DEFER)
1373-
dev_err(dev, "Failed to get clocks: %d\n", ret);
1374-
1375-
return ret;
1376-
}
1371+
if (ret)
1372+
return dev_err_probe(dev, ret, "Failed to get clocks\n");
13771373

13781374
/* The CEC module handles HDMI hotplug detection */
13791375
cec_np = of_get_compatible_child(np->parent, "mediatek,mt8173-cec");
1380-
if (!cec_np) {
1381-
dev_err(dev, "Failed to find CEC node\n");
1382-
return -EINVAL;
1383-
}
1376+
if (!cec_np)
1377+
return dev_err_probe(dev, -EINVAL, "Failed to find CEC node\n");
13841378

13851379
cec_pdev = of_find_device_by_node(cec_np);
13861380
if (!cec_pdev) {
@@ -1429,20 +1423,16 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
14291423
}
14301424

14311425
i2c_np = of_parse_phandle(remote, "ddc-i2c-bus", 0);
1426+
of_node_put(remote);
14321427
if (!i2c_np) {
1433-
dev_err(dev, "Failed to find ddc-i2c-bus node in %pOF\n",
1434-
remote);
1435-
of_node_put(remote);
1436-
ret = -EINVAL;
1428+
ret = dev_err_probe(dev, -EINVAL, "No ddc-i2c-bus in connector\n");
14371429
goto put_device;
14381430
}
1439-
of_node_put(remote);
14401431

14411432
hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np);
14421433
of_node_put(i2c_np);
14431434
if (!hdmi->ddc_adpt) {
1444-
dev_err(dev, "Failed to get ddc i2c adapter by node\n");
1445-
ret = -EINVAL;
1435+
ret = dev_err_probe(dev, -EINVAL, "Failed to get ddc i2c adapter by node\n");
14461436
goto put_device;
14471437
}
14481438

0 commit comments

Comments
 (0)