Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2127253lqo; Mon, 13 May 2024 08:32:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXDpD+meq5Rxv1NhTdiQtuNaumXtDiQIKQZMNSRLj1zRfmmX1Ubm4PxwrIJmXXA+LjpJIVWurWyDYsfgy0OgRi5C7po9n654UyNSDUapA== X-Google-Smtp-Source: AGHT+IFAGFEhxeZ92wCaF5zjAGCXcMtHFTVJGB1zLVqVA3BkeRQ9puaScaKcpyIvP04XhRj5YiAJ X-Received: by 2002:a05:6e02:1583:b0:36b:2464:bd2a with SMTP id e9e14a558f8ab-36cc14588f4mr175530015ab.16.1715614348818; Mon, 13 May 2024 08:32:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715614348; cv=pass; d=google.com; s=arc-20160816; b=DEMk77TSdz3q56qgh255X9iLlu9y5n1Ri8TVwuNs+HL+UIT6utUAOsebfVWUPs4XLJ LuSjOHJ2GYlwL1BCDnzOesbBDMtOthVKucXhmL+aeI4+V4pHqPoBu0l9uuBPQDrd9qr0 xhGxeG5r62iZf1Kp+/TCGQQLtdUvZuf8aFP0QR4Ly4hTJe9NEzsT9KNHQN9WiixT7efx tI15kHSc1n3UQvoqWchJ/Ws7z900+HGfCK59xHc35KJomdHMvYOoun7WO6QX964Uwd0L ZjyUHtIJ/RYz/tp1QMCrxM2fX8ghrUIa4e1+M2cF8iKiWGdxwBBKNM3rJS5sBkUWMyBa Pilw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=VuurdJj3GDklou0Of2HgmHbA6rBjSJAex3DjQZYdsF0=; fh=YtI1unxrdsy37CaPN2XWjLZc9EMsMnSRizG41qMMsuU=; b=IA/kkKz+YAJRWSOm2x+iB74PC46Nkc1dHjfXlIN7vaYNBRZ3nHPxTD40+lEUAz+q/+ UsYwsKnxrr2KCKqn+FhqCVrc82xV1OSJQRt9dQFt/YeYi8qZ+Br0twjSMS/wkFRnTEP9 Ql+2MrQrluqJbNz3RXh2+Gv8W4wuOZctERPK2116pzT1IeRwZGRekqz6eNDNAUEB2AvL GpE3bJs49MVyrRUBC7mCirP3TcqmVbh5Tu1BL7XmuoRUbBfWHVAUSc12OLONUrgxKB7N mGSzILCkqOC6ocfyYVbbUvhaxQD5S+g0KI4TE6rNxi+x1bTeqtX4TLDhVIkb90VUaSDK Hivg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=CDm7CqHc; 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-177750-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177750-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 41be03b00d2f7-63409e816c4si9265786a12.130.2024.05.13.08.32.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 08:32:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177750-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=CDm7CqHc; 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-177750-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177750-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 42F95281D1F for ; Mon, 13 May 2024 15:32:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F82E58100; Mon, 13 May 2024 15:31:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="CDm7CqHc" Received: from out-185.mta1.migadu.com (out-185.mta1.migadu.com [95.215.58.185]) (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 10782154BF3 for ; Mon, 13 May 2024 15:31:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.185 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614295; cv=none; b=QlemRfoWNf/0ygQzNqZnEr/0qQWTyHu3DLXV+mYreTsk+dVV2TYUhYSniS/U1ADC/UjPf4F1AoKl3J9pkx7ddxmNpiunFFMRnIKTGRXwS9bnchkQGdcr0qwcdDzacKWRv2Zal6NdwgZ/PcUTLx2qQMo7jLifuGNBbhOigHWzeLs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614295; c=relaxed/simple; bh=dxoRAAr7aO9h0vQTtim6PDbtF3Jv9vhywmIqCc4bpYM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KB1XEvt7VBoce1YS1lrLxzBh82kegxjYzstiLB0aHfVGmubZC024FrwI+sKtwI5/d6k/AAshZYM1SbIHHhlLv/8cjJhWsTo25dSS/yysHfYWdtoClwAEJKc2By1tk5kjQ7/HTAo/lMfPr3P4RxlACusiyzTrVqV4qtMeZoirEfw= 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=CDm7CqHc; arc=none smtp.client-ip=95.215.58.185 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=1715614292; 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: in-reply-to:in-reply-to:references:references; bh=VuurdJj3GDklou0Of2HgmHbA6rBjSJAex3DjQZYdsF0=; b=CDm7CqHceFKy5OciFO5Mvsz8tZq+kJdT2xpaNPs7kweW+u7wPvo+d1weU0CekuYKywg3bo R0B0oLhklrWIKJN2NRxFMzdNaSPA1lr8rPMjXo6JZWvMswqf+37LLuaOkopxisneLn8No1 iBo5Jq70dtVZzgMc/5dKvoPgj62qCYY= From: Sui Jingfeng To: Laurent Pinchart Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Sascha Hauer , Douglas Anderson , Maxime Ripard , Thomas Zimmermann , Liu Ying , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Sui Jingfeng , Laurent Pinchart 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 Message-ID: <20240513153109.46786-5-sui.jingfeng@linux.dev> In-Reply-To: <20240513153109.46786-1-sui.jingfeng@linux.dev> References: <20240513153109.46786-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 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 Signed-off-by: Sui Jingfeng --- 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