Skip to contentSkip to conversation

drm/mediatek: Remove redundant error printing in mtk_cec_probe()

PATCH In review Zhen Lei 2 participants 3 messages May 11, 2021

Subsystems (3)
lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

PATCH 1/1 drm/mediatek: Remove redundant error printing in mtk_cec_probe()

When devm_ioremap_resource() fails, a clear enough error message will be printed by its subfunction __devm_ioremap_resource(). The error information contains the device name, failure cause, and possibly resource information.

Therefore, remove the error printing here to simplify code and reduce the binary size.

---
 drivers/gpu/drm/mediatek/mtk_cec.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_cec.c +0 -1
index e9cef5c0c8f7eff..fd593ff99bfd447 100644
@@ -197,7 +197,6 @@ static int mtk_cec_probe(struct platform_device *pdev)
 	cec->regs = devm_ioremap_resource(dev, res);
 	if (IS_ERR(cec->regs)) {
 		ret = PTR_ERR(cec->regs);
-		dev_err(dev, "Failed to ioremap cec: %d\n", ret);
 		return ret;
 	}
 
Signature · 1 line
2.26.0.106.g9fadedd
#1 lore raw

Hi Zhen Lei,

Quoted 19 lines · Zhen Lei

When devm_ioremap_resource() fails, a clear enough error message will be printed by its subfunction __devm_ioremap_resource(). The error information contains the device name, failure cause, and possibly resource information.

Therefore, remove the error printing here to simplify code and reduce the binary size.

---
 drivers/gpu/drm/mediatek/mtk_cec.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_cec.c +0 -0
index e9cef5c0c8f7eff..fd593ff99bfd447 100644

drivers/gpu/drm/mediatek/mtk_cec.c static int mtk_cec_probe(struct platform_device *pdev) · line 200

Quoted 5 lines
drivers/gpu/drm/mediatek/mtk_cec.c +0 -1
@@ -197,7 +197,6 @@ static int mtk_cec_probe(struct platform_device *pdev)
 	cec->regs = devm_ioremap_resource(dev, res);
 	if (IS_ERR(cec->regs)) {
 		ret = PTR_ERR(cec->regs);
-		dev_err(dev, "Failed to ioremap cec: %d\n", ret);
 		return ret;

You can just return PTR_ERR() directly. No need to set 'ret'.

baruch

Quoted 1 line
drivers/gpu/drm/mediatek/mtk_cec.c +0 -0
 	}
Signature · 8 lines
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - [email protected] - tel: +972.52.368.4656, http://www.tkos.co.il -

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
#2 lore raw
Quoted 17 lines · Baruch Siach

Hi Zhen Lei,

Quoted 14 lines · Zhen Lei

When devm_ioremap_resource() fails, a clear enough error message will be printed by its subfunction __devm_ioremap_resource(). The error information contains the device name, failure cause, and possibly resource information.

Therefore, remove the error printing here to simplify code and reduce the binary size.

---
 drivers/gpu/drm/mediatek/mtk_cec.c | 1 -
 1 file changed, 1 deletion(-)
Quoted 12 lines

drivers/gpu/drm/mediatek/mtk_cec.c static int mtk_cec_probe(struct platform_device *pdev) · line 200

Quoted 10 lines
drivers/gpu/drm/mediatek/mtk_cec.c +0 -1
index e9cef5c0c8f7eff..fd593ff99bfd447 100644
@@ -197,7 +197,6 @@ static int mtk_cec_probe(struct platform_device *pdev)
 	cec->regs = devm_ioremap_resource(dev, res);
 	if (IS_ERR(cec->regs)) {
 		ret = PTR_ERR(cec->regs);
-		dev_err(dev, "Failed to ioremap cec: %d\n", ret);
 		return ret;

You can just return PTR_ERR() directly. No need to set 'ret'.

Right, I will fix it tomorrow.

Quoted 6 lines

baruch

Quoted 1 line
drivers/gpu/drm/mediatek/mtk_cec.c +0 -0
 	}