drm/mediatek: Remove redundant error printing in mtk_cec_probe()
Subsystems (3)
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
@@ -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
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.
Reported-by Hulk Robot <[email protected]>Signed-off-by Zhen Lei <[email protected]>--- drivers/gpu/drm/mediatek/mtk_cec.c | 1 - 1 file changed, 1 deletion(-)drivers/gpu/drm/mediatek/mtk_cec.c +0
-0
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-mediatekQuoted 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.
Reported-by Hulk Robot <[email protected]>Signed-off-by Zhen Lei <[email protected]>--- 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@@ -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}