From: Sui Jingfeng <sui.jingfeng@linux.dev>
To: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Douglas Anderson <dianders@chromium.org>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
Liu Ying <victor.liu@nxp.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
imx@lists.linux.dev, Sui Jingfeng <sui.jingfeng@linux.dev>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: [PATCH v2 10/12] drm/bridge: lt9611uxc: Remove a redundant check on existence of bridge->encoder
Date: Mon, 13 May 2024 23:31:07 +0800 [thread overview]
Message-ID: <20240513153109.46786-11-sui.jingfeng@linux.dev> (raw)
In-Reply-To: <20240513153109.46786-1-sui.jingfeng@linux.dev>
In the lt9611uxc_connector_init() function, the check on the existence
of bridge->encoder is not necessary, as it has already been checked in
the drm_bridge_attach() function. And the check on the drm bridge core
happens before check in the implementation. Hence, it is guaranteed that
the .encoder member of the struct drm_bridge is not NULL when
lt9611uxc_connector_init() function get called.
Remove the redundant checking codes "if (!bridge->encoder) { ... }".
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sui Jingfeng <sui.jingfeng@linux.dev>
---
drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
index ab702471f3ab..f864c033ba81 100644
--- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
+++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c
@@ -337,11 +337,6 @@ static int lt9611uxc_connector_init(struct drm_bridge *bridge, struct lt9611uxc
{
int ret;
- if (!bridge->encoder) {
- DRM_ERROR("Parent encoder object not found");
- return -ENODEV;
- }
-
lt9611uxc->connector.polled = DRM_CONNECTOR_POLL_HPD;
drm_connector_helper_add(<9611uxc->connector,
--
2.43.0
next prev parent reply other threads:[~2024-05-13 15:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-13 15:30 [PATCH v2 00/12] Remove redundant checks on existence of 'bridge->encoder' Sui Jingfeng
2024-05-13 15:30 ` [PATCH v2 01/12] drm/bridge: simple-bridge: Remove a redundant check on existence of bridge->encoder Sui Jingfeng
2024-05-13 15:30 ` [PATCH v2 02/12] drm/bridge: tfp410: " Sui Jingfeng
2024-05-13 15:31 ` [PATCH v2 03/12] drm/bridge: nxp-ptn3460: " Sui Jingfeng
2024-05-13 15:31 ` [PATCH v2 04/12] drm/bridge: panel: " Sui Jingfeng
2024-05-13 15:31 ` [PATCH v2 05/12] drm/bridge: it6505: " Sui Jingfeng
2024-05-13 15:31 ` [PATCH v2 06/12] drm/bridge: adv7511: " Sui Jingfeng
2024-05-13 15:31 ` [PATCH v2 07/12] drm/bridge: cdns-mhdp8546: " Sui Jingfeng
2024-05-13 15:31 ` [PATCH v2 08/12] drm/bridge: megachips-stdpxxxx-ge-b850v3-fw: " Sui Jingfeng
2024-05-13 15:31 ` [PATCH v2 09/12] drm/bridge: synopsys: dw-mipi-dsi: " Sui Jingfeng
2024-05-13 15:31 ` Sui Jingfeng [this message]
2024-05-13 15:31 ` [PATCH v2 11/12] drm/bridge: imx: Remove redundant checks " Sui Jingfeng
2024-05-13 15:31 ` [PATCH v2 12/12] drm/bridge: analogix: " Sui Jingfeng
2024-05-13 16:35 ` [PATCH v2 00/12] Remove redundant checks on existence of 'bridge->encoder' Robert Foss
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=20240513153109.46786-11-sui.jingfeng@linux.dev \
--to=sui.jingfeng@linux.dev \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=andrzej.hajda@intel.com \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=imx@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=tzimmermann@suse.de \
--cc=victor.liu@nxp.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.