Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1081117lqo; Sat, 11 May 2024 06:43:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVACWs7qiVtAVmenama8fO97bMdG1eqw2pIHk4SsSEFOiyKCZCEnDomo6aII470JlYOR3yTlbMrUPWDGJn5pP1qHApXq0w/65GoNFPOig== X-Google-Smtp-Source: AGHT+IGHYGeaEHogaginUvu4u7dBeMUAcE5Qkmf2r54MGZpxRIqdhb0bM7gh3bg6u6RqqotZvJbU X-Received: by 2002:a5d:8602:0:b0:7d3:4ef3:e6c1 with SMTP id ca18e2360f4ac-7e1b51c5497mr647295539f.10.1715434991371; Sat, 11 May 2024 06:43:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715434991; cv=pass; d=google.com; s=arc-20160816; b=j/FNmJ+alJdi+oo5fq2mPT0vJQdG68GQCBbrWOhVESR9SVmOk3CljYH9kwhD83s0QF QY+Z1gdDhN5c6H2In/DW3tvR6DFvJny0qvBo4QlunFUUaKNhAebLpPzhHiVThjZwqFpX 5zH4Y3osygIiepI6OtwWb9Hp7VtxrB6jmslXr3VBpbuQOhrWiLxakrA/4cmfmnPzTsP7 tmkWdNe5zTLaVjj/rVhAy06Hq/BGcAHveljf41FjYqNk14lXFCtpOZO+7VjCZbV9a4ko ktdeUtusiw4p2vt40mnZ71KVbFqYPl3+EwwXqhIhY5r8Mxt8sxaahKFn58jwI+5us2ah lBqg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=RgtGAFbku9bwQJoqLJ8e+foNfnAXhgDDb46wiVqco90=; fh=wOxYnf5cB8EXtrDPB+7Ap+AE3ORvvjAbNrmA+4qPZLg=; b=KrDM8dM0+0Vc9r6cs6YgCklrl6nUdkgng5fGc7WC0O7To6rsyimRmzseNhlxh67HIv 4SyYTr75oWX5KtY1v+FDzxkBXInpeb5Zh4QWn5piX67jr5dDtqhtLwYocGk5Cs4KU7it RjcHmDnu0f+GQGp1HJ04PI3VFucv6sQc0jSpzAZACQWDsdfgPrQXZkA32/Z/3fHLByKS iDowSuyIRwGPXDeVR3F2dB66aWYvsMmD04m8bjwcHA6qVM5pC8GjJi/nowtsIen01FNx iH8fUNjCFUGQzqm2lN5nsBclSJPXw2iI9s8O86XHvv8fT+67dA6AFIIeJCvUi0ken+St 1nGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=qK9cMOWO; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-176563-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176563-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2b43c65si5713968b3a.372.2024.05.11.06.43.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 06:43:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176563-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=qK9cMOWO; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-176563-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176563-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BA8FF281E12 for ; Sat, 11 May 2024 13:43:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42BD653373; Sat, 11 May 2024 13:43:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="qK9cMOWO" Received: from out-173.mta0.migadu.com (out-173.mta0.migadu.com [91.218.175.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D2906FC6 for ; Sat, 11 May 2024 13:43:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715434985; cv=none; b=aF28aPIqpa5pHn76TGedAP+zUs+dbf3Ns7KKzo69lpsgImlIa1VmX9tMcQtHtta5BREaFy3NEBRymvc5G949e8F0gBbehB/BtvOcWdbEJhn/RO1GhUXnBcmR+0ySVKFTZQ3C7P1Hd14scdS50iWhPxt+xbbQJWlC7zX23JoK+og= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715434985; c=relaxed/simple; bh=5e3+lzc93eLN1U5/WEyH120IBkdktfJJJGOghG1BnGs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CsRb5LZZCiEvCdu8Q183P4rO39KUeFefrRHcWkV5wApAuSPqVIx9QB9AO3xcCnl9PWR1AAlYDCA4+IO8OzxRJx06QqqMec/fXe3gqo7CR4HIhL5jo2q05N6hAKWbCD8nvDOX4A5J3bAB0EeK7CT1HUDv3TImIYmQ6BGId6/KiW0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=qK9cMOWO; arc=none smtp.client-ip=91.218.175.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 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 --- 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); -- 2.43.0