Skip to content

Commit 16e57a7

Browse files
Dan Carpentermripard
authored andcommitted
drm/vc4: hdmi: Fix some NULL vs IS_ERR() bugs
The devm_platform_ioremap_resource_byname() function doesn't return NULL, it returns error pointers. Update the checking to match. Fixes: b93f07c ("drm/vc4: move to devm_platform_ioremap_resource() usage") Signed-off-by: Dan Carpenter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
1 parent 30188df commit 16e57a7

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,8 +2928,8 @@ static int vc5_hdmi_init_resources(struct drm_device *drm,
29282928

29292929
vc4_hdmi->hdmicore_regs = devm_platform_ioremap_resource_byname(pdev,
29302930
"hdmi");
2931-
if (!vc4_hdmi->hdmicore_regs)
2932-
return -ENOMEM;
2931+
if (IS_ERR(vc4_hdmi->hdmicore_regs))
2932+
return PTR_ERR(vc4_hdmi->hdmicore_regs);
29332933

29342934
/* This is shared between both HDMI controllers. Cannot
29352935
* claim for both instances. Lets not convert to using
@@ -2946,33 +2946,33 @@ static int vc5_hdmi_init_resources(struct drm_device *drm,
29462946

29472947
vc4_hdmi->cec_regs = devm_platform_ioremap_resource_byname(pdev,
29482948
"cec");
2949-
if (!vc4_hdmi->cec_regs)
2950-
return -ENOMEM;
2949+
if (IS_ERR(vc4_hdmi->cec_regs))
2950+
return PTR_ERR(vc4_hdmi->cec_regs);
29512951

29522952
vc4_hdmi->csc_regs = devm_platform_ioremap_resource_byname(pdev,
29532953
"csc");
2954-
if (!vc4_hdmi->csc_regs)
2955-
return -ENOMEM;
2954+
if (IS_ERR(vc4_hdmi->csc_regs))
2955+
return PTR_ERR(vc4_hdmi->csc_regs);
29562956

29572957
vc4_hdmi->dvp_regs = devm_platform_ioremap_resource_byname(pdev,
29582958
"dvp");
2959-
if (!vc4_hdmi->dvp_regs)
2960-
return -ENOMEM;
2959+
if (IS_ERR(vc4_hdmi->dvp_regs))
2960+
return PTR_ERR(vc4_hdmi->dvp_regs);
29612961

29622962
vc4_hdmi->phy_regs = devm_platform_ioremap_resource_byname(pdev,
29632963
"phy");
29642964

2965-
if (!vc4_hdmi->phy_regs)
2966-
return -ENOMEM;
2965+
if (IS_ERR(vc4_hdmi->phy_regs))
2966+
return PTR_ERR(vc4_hdmi->phy_regs);
29672967

29682968
vc4_hdmi->ram_regs = devm_platform_ioremap_resource_byname(pdev,
29692969
"packet");
2970-
if (!vc4_hdmi->ram_regs)
2971-
return -ENOMEM;
2970+
if (IS_ERR(vc4_hdmi->ram_regs))
2971+
return PTR_ERR(vc4_hdmi->ram_regs);
29722972

29732973
vc4_hdmi->rm_regs = devm_platform_ioremap_resource_byname(pdev, "rm");
2974-
if (!vc4_hdmi->rm_regs)
2975-
return -ENOMEM;
2974+
if (IS_ERR(vc4_hdmi->rm_regs))
2975+
return PTR_ERR(vc4_hdmi->rm_regs);
29762976

29772977
vc4_hdmi->hsm_clock = devm_clk_get(dev, "hdmi");
29782978
if (IS_ERR(vc4_hdmi->hsm_clock)) {

0 commit comments

Comments
 (0)