From: Dan Carpenter <dan.carpenter@linaro.org>
To: Anusha Srivatsa <asrivats@redhat.com>
Cc: "Maxime Ripard" <mripard@kernel.org>,
"Dave Stevenson" <dave.stevenson@raspberrypi.com>,
"Maíra Canal" <mcanal@igalia.com>,
"Raspberry Pi Kernel Maintenance" <kernel-list@raspberrypi.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH next] drm/vc4: hdmi: Fix some NULL vs IS_ERR() bugs
Date: Fri, 28 Feb 2025 12:38:17 +0300 [thread overview]
Message-ID: <a952e2b4-d4b8-49ac-abd9-9967c50f4a80@stanley.mountain> (raw)
The devm_platform_ioremap_resource_byname() function doesn't return NULL,
it returns error pointers. Update the checking to match.
Fixes: b93f07cf090a ("drm/vc4: move to devm_platform_ioremap_resource() usage")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index d20e5c53ba75..37238a12baa5 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -2928,8 +2928,8 @@ static int vc5_hdmi_init_resources(struct drm_device *drm,
vc4_hdmi->hdmicore_regs = devm_platform_ioremap_resource_byname(pdev,
"hdmi");
- if (!vc4_hdmi->hdmicore_regs)
- return -ENOMEM;
+ if (IS_ERR(vc4_hdmi->hdmicore_regs))
+ return PTR_ERR(vc4_hdmi->hdmicore_regs);
/* This is shared between both HDMI controllers. Cannot
* claim for both instances. Lets not convert to using
@@ -2946,33 +2946,33 @@ static int vc5_hdmi_init_resources(struct drm_device *drm,
vc4_hdmi->cec_regs = devm_platform_ioremap_resource_byname(pdev,
"cec");
- if (!vc4_hdmi->cec_regs)
- return -ENOMEM;
+ if (IS_ERR(vc4_hdmi->cec_regs))
+ return PTR_ERR(vc4_hdmi->cec_regs);
vc4_hdmi->csc_regs = devm_platform_ioremap_resource_byname(pdev,
"csc");
- if (!vc4_hdmi->csc_regs)
- return -ENOMEM;
+ if (IS_ERR(vc4_hdmi->csc_regs))
+ return PTR_ERR(vc4_hdmi->csc_regs);
vc4_hdmi->dvp_regs = devm_platform_ioremap_resource_byname(pdev,
"dvp");
- if (!vc4_hdmi->dvp_regs)
- return -ENOMEM;
+ if (IS_ERR(vc4_hdmi->dvp_regs))
+ return PTR_ERR(vc4_hdmi->dvp_regs);
vc4_hdmi->phy_regs = devm_platform_ioremap_resource_byname(pdev,
"phy");
- if (!vc4_hdmi->phy_regs)
- return -ENOMEM;
+ if (IS_ERR(vc4_hdmi->phy_regs))
+ return PTR_ERR(vc4_hdmi->phy_regs);
vc4_hdmi->ram_regs = devm_platform_ioremap_resource_byname(pdev,
"packet");
- if (!vc4_hdmi->ram_regs)
- return -ENOMEM;
+ if (IS_ERR(vc4_hdmi->ram_regs))
+ return PTR_ERR(vc4_hdmi->ram_regs);
vc4_hdmi->rm_regs = devm_platform_ioremap_resource_byname(pdev, "rm");
- if (!vc4_hdmi->rm_regs)
- return -ENOMEM;
+ if (IS_ERR(vc4_hdmi->rm_regs))
+ return PTR_ERR(vc4_hdmi->rm_regs);
vc4_hdmi->hsm_clock = devm_clk_get(dev, "hdmi");
if (IS_ERR(vc4_hdmi->hsm_clock)) {
--
2.47.2
next reply other threads:[~2025-02-28 9:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 9:38 Dan Carpenter [this message]
2025-03-03 13:25 ` Maxime Ripard
[not found] ` <CAN9Xe3R-nyCcTRhDTeWFrW9EVnpdRG2Nyz=qjiYB0pzFM3NxWw@mail.gmail.com>
2025-03-04 16:46 ` Maxime Ripard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a952e2b4-d4b8-49ac-abd9-9967c50f4a80@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=airlied@gmail.com \
--cc=asrivats@redhat.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=kernel-list@raspberrypi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mcanal@igalia.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®