Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2126740lqo; Mon, 13 May 2024 08:31:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXHI+8EEj9gluw36qin4s/49OTd6glg2ia/TksJM+FTvnHpSqX+3/IKoKxb65kfRyWlxYGDuXKRwo3doiW3PNCKy80y1q7HzPKZ6IJn4g== X-Google-Smtp-Source: AGHT+IHu2n2CWKZz9q3fbiFYWGwX3CPbNQ+sZ1Gh83UStdhq2lhuF0kr8Pq9hAy8DyI1uZcTZxK3 X-Received: by 2002:a05:6358:9486:b0:192:711e:d796 with SMTP id e5c5f4694b2df-193bb2adfd9mr1143360255d.25.1715614307819; Mon, 13 May 2024 08:31:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715614307; cv=pass; d=google.com; s=arc-20160816; b=Mc+vnnqUIA8LvSsfqhg/hE4P+TqRgRiAuISUjf6zAZ4VCr4G6/1zhb9Q/kunOiYz2N 43N7v+48aVCRmbeFstvPqGOqepjjiGAqHxhUSCAjRUdse4LjdFdUJbGGwD6VLPj8sA12 QKc86TBeRTVxEonsZ86nmypON//Wi3TyO81BBfEYF78ftMUNhh+PTzMHiGpXh3i4LM6R zqr0YNsbcrbmVwgqWryHVriRzKguWUbjin0GPvSr6uf+p7xDM0H4Shzz1bsugjo+O6WJ 0uWCUZMrS9ussXXh95zedeiETwVJ4ITgNMvJ/D+iRQBlG38E/awODMqPQT7G4mX7DRni +lFQ== 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=WiifdoFYgTp3rVEK2qqeyz0G8r+zsR9iFqUJx/OeTgY=; fh=YtI1unxrdsy37CaPN2XWjLZc9EMsMnSRizG41qMMsuU=; b=wStua9nQrd66CS81/ni52pnitKv2HTlyudRUDkiWRVx3z3xJMYDCthWMHjR8yW8fC7 6d8B5jg0zgYenbJ7g5s36+6lzZFbEQdC3fF69jxImavABcerWEyjTat+scQvRgZ6Gajf KBaoMVSnFnXEiB1TIedZBUiINadoIl7m3B51WHsaUSaeEpekjAIUK50bMhRBt2G65QE5 CNx995HMCjoDgYde3YRv7JI2OVUbs0V4z1yRKz9ObV60x3yYDHQ+lxq76ZbyS8BLK94y 9C0pR1cKT+isAR1TmJ/kxRE9l2/gXeIEs1okO/qboPmZZYclY2OQueCjxUgyWTKkjQV2 HWrg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=xv2NJ8oB; 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-177747-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43df549c9e5si87046741cf.153.2024.05.13.08.31.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 08:31:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177747-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=xv2NJ8oB; 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-177747-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177747-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 860D61C23159 for ; Mon, 13 May 2024 15:31:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D7E8154428; Mon, 13 May 2024 15:31:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="xv2NJ8oB" Received: from out-171.mta1.migadu.com (out-171.mta1.migadu.com [95.215.58.171]) (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 999F11474CA for ; Mon, 13 May 2024 15:31:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614286; cv=none; b=nKUmGRdlnbiL2umuGciU6qGPMdaizAafZO90ED37A8cRv1kQUXNN7OHWRl/dyTvHpEUv03vmPrdAZu3ruvtLl9XY2i40UuOB9kIFR5FSszy7PtfXQtLpQGO2cux16J+3nEPX/CpZumwnrUgdjVoerB/0Nn2JHfXon5k3W4KcsjE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614286; c=relaxed/simple; bh=l89qcY05vZBXoEEEwzVwYsUrgne6mG0qP39cHxCZ9YY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DTbPOVWgLBxR83ZDhgyUaVvfU60XEXLPQu8ihybLuQJ1qzkV2IIXHui6veoyLGtR3/9TvoEa2ttfhP5ybGdaZ+tj/pXAIi8p3D+nyR6Oov7yZ4ZEr4Gg7EVxPlEU7rS+oY7sC20IzYDf+FV6e53jrjT+pNOamxeIB5oG1oZlwAg= 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=xv2NJ8oB; arc=none smtp.client-ip=95.215.58.171 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=1715614282; 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=WiifdoFYgTp3rVEK2qqeyz0G8r+zsR9iFqUJx/OeTgY=; b=xv2NJ8oBRndXa8ykHGEtOp3Az38+Qtnmuim843TUjh1gWieTYWz6a7OMJGYlc8wi2pYIv+ Cssj7AOECrLYKW8tryoychMlunWVtWmb/Gk5UrnSjOGQMlLDcmUjgvKF5/dAfOFKyP3GN3 sXGdeBCJWv2VOdSAh5ARWgXx27CFts8= 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 01/12] drm/bridge: simple-bridge: Remove a redundant check on existence of bridge->encoder Date: Mon, 13 May 2024 23:30:58 +0800 Message-ID: <20240513153109.46786-2-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 simple_bridge_attach() function get called, and 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 the simple_bridge_attach() get called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Reviewed-by: Laurent Pinchart Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/simple-bridge.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/simple-bridge.c b/drivers/gpu/drm/bridge/simple-bridge.c index 5813a2c4fc5e..2ca89f313cd1 100644 --- a/drivers/gpu/drm/bridge/simple-bridge.c +++ b/drivers/gpu/drm/bridge/simple-bridge.c @@ -116,11 +116,6 @@ static int simple_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(&sbridge->connector, &simple_bridge_con_helper_funcs); ret = drm_connector_init_with_ddc(bridge->dev, &sbridge->connector, -- 2.43.0