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+renesas@ideasonboard.com>
Subject: [PATCH v2 06/12] drm/bridge: adv7511: Remove a redundant check on existence of bridge->encoder
Date: Mon, 13 May 2024 23:31:03 +0800 [thread overview]
Message-ID: <20240513153109.46786-7-sui.jingfeng@linux.dev> (raw)
In-Reply-To: <20240513153109.46786-1-sui.jingfeng@linux.dev>
In the adv7511_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() which happens prior to the adv7511_bridge_attach()
get called. Also note that the adv7511_connector_init() is only called by
adv7511_bridge_attach(). Hence, it is guaranteed that the .encoder member
of the drm_bridge instance is not NULL when adv7511_connector_init() get
called.
Remove the redundant checking codes "if (!bridge->encoder) { ... }".
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Sui Jingfeng <sui.jingfeng@linux.dev>
---
drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index dd21b81bd28f..6089b0bb9321 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -877,11 +877,6 @@ static int adv7511_connector_init(struct adv7511 *adv)
struct drm_bridge *bridge = &adv->bridge;
int ret;
- if (!bridge->encoder) {
- DRM_ERROR("Parent encoder object not found");
- return -ENODEV;
- }
-
if (adv->i2c_main->irq)
adv->connector.polled = DRM_CONNECTOR_POLL_HPD;
else
--
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 ` Sui Jingfeng [this message]
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 ` [PATCH v2 10/12] drm/bridge: lt9611uxc: " Sui Jingfeng
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-7-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=laurent.pinchart+renesas@ideasonboard.com \
--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.