[PATCH 4/4] drm/omap: dss: Use PTR_ERR_OR_ZERO() to simplify code in hdmi_phy_init
zhengbin
zhengbin13 at huawei.com
Mon Nov 18 12:07:33 UTC 2019
Fixes coccicheck warning:
drivers/gpu/drm/omapdrm/dss/hdmi_phy.c:194:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Reported-by: Hulk Robot <hulkci at huawei.com>
Signed-off-by: zhengbin <zhengbin13 at huawei.com>
---
drivers/gpu/drm/omapdrm/dss/hdmi_phy.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi_phy.c b/drivers/gpu/drm/omapdrm/dss/hdmi_phy.c
index 00bbf24..408b2e0 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi_phy.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi_phy.c
@@ -191,8 +191,5 @@ int hdmi_phy_init(struct platform_device *pdev, struct hdmi_phy_data *phy,
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy");
phy->base = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(phy->base))
- return PTR_ERR(phy->base);
-
- return 0;
+ return PTR_ERR_OR_ZERO(phy->base);
}
--
2.7.4
More information about the dri-devel
mailing list