All of lore.kernel.org
 help / color / mirror / Atom feed
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 04/12] drm/bridge: panel: Remove a redundant check on existence of bridge->encoder
Date: Mon, 13 May 2024 23:31:01 +0800	[thread overview]
Message-ID: <20240513153109.46786-5-sui.jingfeng@linux.dev> (raw)
In-Reply-To: <20240513153109.46786-1-sui.jingfeng@linux.dev>

Because the existence of 'bridge->encoder' has already been checked before
the panel_bridge_attach() function get called, and the 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 panel_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/panel.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c
index 32506524d9a2..56c40b516a8f 100644
--- a/drivers/gpu/drm/bridge/panel.c
+++ b/drivers/gpu/drm/bridge/panel.c
@@ -67,11 +67,6 @@ static int panel_bridge_attach(struct drm_bridge *bridge,
 	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
 		return 0;
 
-	if (!bridge->encoder) {
-		DRM_ERROR("Missing encoder\n");
-		return -ENODEV;
-	}
-
 	drm_connector_helper_add(connector,
 				 &panel_bridge_connector_helper_funcs);
 
-- 
2.43.0


  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 ` Sui Jingfeng [this message]
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 ` [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-5-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.