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 05/12] drm/bridge: it6505: Remove a redundant check on existence of bridge->encoder
Date: Mon, 13 May 2024 23:31:02 +0800 [thread overview]
Message-ID: <20240513153109.46786-6-sui.jingfeng@linux.dev> (raw)
In-Reply-To: <20240513153109.46786-1-sui.jingfeng@linux.dev>
In it6505_bridge_attach(), 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 it6505_bridge_attach() get called. Note that the
it6505_bridge_attach() will only be called by .attach() of the previous
bridge or KMS driver. The previous drm_bridge_attach() will quit with a
negative error code returned if it fails for some reasons. Hence, it is
guaranteed that the .encoder member of the drm_bridge instance is not NULL
when it6505_bridge_attach() 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/ite-it6505.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c
index 3f68c82888c2..469157341f3a 100644
--- a/drivers/gpu/drm/bridge/ite-it6505.c
+++ b/drivers/gpu/drm/bridge/ite-it6505.c
@@ -2882,11 +2882,6 @@ static int it6505_bridge_attach(struct drm_bridge *bridge,
return -EINVAL;
}
- if (!bridge->encoder) {
- dev_err(dev, "Parent encoder object not found");
- return -ENODEV;
- }
-
/* Register aux channel */
it6505->aux.drm_dev = bridge->dev;
--
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 ` Sui Jingfeng [this message]
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 ` [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-6-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.