From patchwork Sat May 11 13:42:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13662392 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 340A8C04FFE for ; Sat, 11 May 2024 13:43:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 511D510E15D; Sat, 11 May 2024 13:43:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=linux.dev header.i=@linux.dev header.b="qK9cMOWO"; dkim-atps=neutral Received: from out-187.mta0.migadu.com (out-187.mta0.migadu.com [91.218.175.187]) by gabe.freedesktop.org (Postfix) with ESMTPS id E627310E15D for ; Sat, 11 May 2024 13:43:03 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1715434980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=RgtGAFbku9bwQJoqLJ8e+foNfnAXhgDDb46wiVqco90=; b=qK9cMOWOcTh9nApidPyn0t0k6Xl41N2Ja8jfAEZasuVfIsEmAVGkSnmymzIZ++FmEt7Nji IDu1WggGereH5bWvjMNlw1Vbo987sVju+TBtz6bQ27IGhMWfWl642X5l/eg/5C4v1s0OgC 893B6O06NZr/CbCnnI1GS90etmlS1QA= From: Sui Jingfeng To: Maxime Ripard Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sui Jingfeng Subject: [PATCH] drm/bridge: nxp-ptn3460: Remove a small useless code snippet Date: Sat, 11 May 2024 21:42:50 +0800 Message-ID: <20240511134251.313513-1-sui.jingfeng@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In ptn3460_bridge_attach(), the check on the existence of bridge->encoder has already been done in the implementation of drm_bridge_attach(). The driver won't go further if bridge->encoder is NULL and the driver will quit even if drm_bridge_attach() fails for some reasons. Thereforei, there is no need to check another time at the later, remove the redundant checking codes "if (!bridge->encoder) { ... }". Signed-off-by: Sui Jingfeng Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/bridge/nxp-ptn3460.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/nxp-ptn3460.c b/drivers/gpu/drm/bridge/nxp-ptn3460.c index ed93fd4c3265..e77aab965fcf 100644 --- a/drivers/gpu/drm/bridge/nxp-ptn3460.c +++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c @@ -229,11 +229,6 @@ static int ptn3460_bridge_attach(struct drm_bridge *bridge, if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) return 0; - if (!bridge->encoder) { - DRM_ERROR("Parent encoder object not found"); - return -ENODEV; - } - ptn_bridge->connector.polled = DRM_CONNECTOR_POLL_HPD; ret = drm_connector_init(bridge->dev, &ptn_bridge->connector, &ptn3460_connector_funcs, DRM_MODE_CONNECTOR_LVDS);