Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2128244lqo; Mon, 13 May 2024 08:33:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVp70QHKlUaOVfNbYheg+3kvu0E+0Z/xWNH+uTI4c9036QIlj86gkTs6zk9H5zQnr5juW/B0dWFW8yZm0P/Iyu8eXXv/Cm2ClKUe1rpWw== X-Google-Smtp-Source: AGHT+IEkoaEIMqS3gFJ9rZR+b98XsHJXFDo/mc2G64deZi4SCwuRhVKvYzdnK/gPPRQt0kRpqtUT X-Received: by 2002:a05:6122:369c:b0:4ca:80c5:7544 with SMTP id 71dfb90a1353d-4df8829f26emr7630605e0c.4.1715614437174; Mon, 13 May 2024 08:33:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715614437; cv=pass; d=google.com; s=arc-20160816; b=QW6oyDGdgK4sM1oL54rMF4f2cgVkmkbHHk7ketg2VXvVfuRRKNW+H0jUKsNXldOBRI LX0Srrp2k+sfF9uxPpQ/WXTz68VDTAgsLd6gXnXQ8rHNQ/43yIJEa8AaIAyTQsC7OHDh QMkUgWF4yvIV8TSwoFl1QnUCfZu71O0apSM4bgMdpNTqIpSXgk6cQ6E8Og87iJGQZIV4 JbbR1nuhw+Ee7s5pfNZ73dMb7VrGfDCYAfAoCJ3u0p3Iavg+hQBOZEEsFm10cC+qcUI9 l+iCZGcCWbC7NcbZ+avhPMlqBPa0p30d3/yfsFUBkC/5uFMfpv8oQoBLy08fq//JK1ny 2EhA== 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=LGJqJECahkwNkaZ/cGV67QeDc8nXZjPhmnwOmMDzO3M=; fh=QmDsPKKo1/GhQNA/6PS1Eb8WeC3t5/iv781khUubrIA=; b=i95Qm6/tciDY0vFB8Yg9ixOogbsTR2gegdPyxeumGzs/I3Bh5Q/jLTcmEI58ttdJYN sHitLXMvdeZFiZa5SgzYjmQ+JrSsys7AgNdEJvTSoQZJmeTracVzIxVtdRx8eaWmd8vz yjjmHyoGFf9Q1vQ8qEj+9l2THN3oe0updeKZWX0Py4gfnuOfZ5dlG8anmY+bDDiGDlWC IkQN+qL328tjdSFHNEO4u+B1ETm1zCYG+Z0fbFTSvxyGqkBj311loRuvVyGv2Pqw7vqr 3ma83Djm4HEfIMef8b0WRxE4tPm2sdtq4uf+rrBX7JkLFO5LvsWW/Fx0c3lD5hvXn5ES zBMw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=DrUk8JYN; 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-177752-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177752-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 71dfb90a1353d-4df7c05a5b3si1686485e0c.156.2024.05.13.08.33.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 08:33:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177752-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=DrUk8JYN; 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-177752-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177752-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 17B341C235D0 for ; Mon, 13 May 2024 15:32:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 98AC057CAA; Mon, 13 May 2024 15:31:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="DrUk8JYN" Received: from out-172.mta1.migadu.com (out-172.mta1.migadu.com [95.215.58.172]) (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 3D447155301 for ; Mon, 13 May 2024 15:31:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614302; cv=none; b=nYYO8NEJWCdJczMZgkixKltXCDgE7iGH3cgpBw6B9ejwKxTEZPd2gTyqKLqfm3IO5hlyeYjJnnqewCJlJZc9FARx8AtCY/IW7fOv9SXkUYNMh1JPOokrUvoFoFXWuo1JNb6fiL+sLjfqkdHtu0am4uF0N44eEVcximFEReTLUoY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614302; c=relaxed/simple; bh=lnqw1YTHyaD5vTzvWJEUqngsLI3DDxbgjrRrlUhJypM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KlKl3XQDvOcr6VhrCDTyjdbJicYEz3clI8poWr5JwHUB76mNSp9BrooiWrHHTmhXdpL7g1JKQ8WqfjURnHCmiaTWIGxbsIMVW+s6N68g57D4aujEnoN4DLaxO+vgEUudcckX/B8Qktotl43BZYfo4BRhLSopLlD4cWATwP5HCQI= 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=DrUk8JYN; arc=none smtp.client-ip=95.215.58.172 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=1715614299; 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=LGJqJECahkwNkaZ/cGV67QeDc8nXZjPhmnwOmMDzO3M=; b=DrUk8JYNcWvrAlPWGbKZ5vymd+/ZTLOLrTm+IESf6ZAkLPN8sjXypzROs9T1GaPvu9cZek kT48XheRlnJJSwe86kbdejo7BdYhAMAR6lsT/ZMAEG1y3QB8VLVUy3Cs5znhiSGDlzLzRA Fd7poJ1Duj8us1n0DLskdDHmVok2voA= 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 06/12] drm/bridge: adv7511: Remove a redundant check on existence of bridge->encoder Date: Mon, 13 May 2024 23:31:03 +0800 Message-ID: <20240513153109.46786-7-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 In the adv7511_connector_init() function, the check on the existence of bridge->encoder is not necessary. As it has already been checked in the drm_bridge_attach() which happens prior to the adv7511_bridge_attach() get called. Also note that the adv7511_connector_init() is only called by adv7511_bridge_attach(). Hence, it is guaranteed that the .encoder member of the drm_bridge instance is not NULL when adv7511_connector_init() get called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Reviewed-by: Laurent Pinchart Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index dd21b81bd28f..6089b0bb9321 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -877,11 +877,6 @@ static int adv7511_connector_init(struct adv7511 *adv) struct drm_bridge *bridge = &adv->bridge; int ret; - if (!bridge->encoder) { - DRM_ERROR("Parent encoder object not found"); - return -ENODEV; - } - if (adv->i2c_main->irq) adv->connector.polled = DRM_CONNECTOR_POLL_HPD; else -- 2.43.0