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 07/12] drm/bridge: cdns-mhdp8546: Remove a redundant check on existence of bridge->encoder
Date: Mon, 13 May 2024 23:31:04 +0800 [thread overview]
Message-ID: <20240513153109.46786-8-sui.jingfeng@linux.dev> (raw)
In-Reply-To: <20240513153109.46786-1-sui.jingfeng@linux.dev>
In the cdns_mhdp_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. As the cdns_mhdp_connector_init() is
only called by cdns_mhdp_attach(), it is guaranteed that the .encoder
member of the struct drm_bridge is not NULL when cdns_mhdp_attach() gets
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/cadence/cdns-mhdp8546-core.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
index 8a91ef0ae065..dee640ab1d3a 100644
--- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
+++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
@@ -1697,11 +1697,6 @@ static int cdns_mhdp_connector_init(struct cdns_mhdp_device *mhdp)
struct drm_bridge *bridge = &mhdp->bridge;
int ret;
- if (!bridge->encoder) {
- dev_err(mhdp->dev, "Parent encoder object not found");
- return -ENODEV;
- }
-
conn->polled = DRM_CONNECTOR_POLL_HPD;
ret = drm_connector_init(bridge->dev, conn, &cdns_mhdp_conn_funcs,
--
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 ` Sui Jingfeng [this message]
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-8-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox