Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2128179lqo; Mon, 13 May 2024 08:33:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXpmIb1fhbfxkp0AR6s65851vnAEyr4FwxOFYvu6Q0z1U2MtoZDM329fOU1rHGPlAFbOFwqPt5qker7tSr0fVi005x8cCse0eoB3vHsEg== X-Google-Smtp-Source: AGHT+IHR7AubYnI6TMNhsrThAquSKvuO4DGNjq/TnlXAx3VuRABvMfMtpfiHWg4+H/Wo4fcd4n2W X-Received: by 2002:a9d:7d17:0:b0:6ed:e4fc:b78e with SMTP id 46e09a7af769-6f0e9292552mr11937927a34.26.1715614430442; Mon, 13 May 2024 08:33:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715614430; cv=pass; d=google.com; s=arc-20160816; b=H3efNJuNq4m/IHdllLPFWp6x3jHA0SbICWH3OeoMSQMLp8sUtM9tR6jvfW9Q/Fr1MA y4VlpMcDtHeEyAak8ROl9AzWhXdwxb+ftkvW0A4JF9/Tv5CIdBCELMMQoTcj32QsyyG8 ub5AaZPB/PRcdbquPegJEd2fhQ3hLToyd2ZqKhL2TcaLhcQhZB2B8DY3Nb3/u0uA1Kpt LzG/7iTvHHS9LTN+KMf19PNy16ySpoopYwLaExtF2CIbRY7lWloDac801OxI9TYr0DIV aJ++kjO+Ii5DlWlHOYdulFrsi1TlvJR0Fiu8WWGXQGiDGvwNIxyiuqPvGFTX2PDXdirS s98Q== 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=iDFYXwTyTrz+GVTosm5TTL0X5z5slov+AkciH3erF0Y=; fh=YtI1unxrdsy37CaPN2XWjLZc9EMsMnSRizG41qMMsuU=; b=hfR6jIAO+LhqXkMfu/qYueT3paC6nl/AqZRR9ienJwY4yZpGf5RZrZ0Gze+Hqs7nQa rAfdETFGQhtpdxpUQ6KZchrK1m+D9kDIzYT0fXN/YVbzWat/2QO6vcxAUJQWnemvG1Q3 okFd67P7SLrW+nPfzRHYunos7c53/nxucpPn/ZovQ4Vr5uWir7XFOeIHeGjlLSSr7rxO sLWsA4x2pGpTM8xSI14gnRLj9BBNrskUym6j+QjOodVqehZOhcWyPev7Gl6EqL4C0ilx T8zFLgvCM2Cw2KKGBdz32X7kpb2sJ6s+XTElZKWLUPytka7OhFefBz1SHlzpNgpd34tO Ok6g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=cw4tRIsd; 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-177751-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177751-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 a1e0cc1a2514c-7f8ffa09eedsi1611919241.55.2024.05.13.08.33.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 08:33:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177751-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=cw4tRIsd; 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-177751-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177751-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 0C18D1C235CF for ; Mon, 13 May 2024 15:32:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A21661552FA; Mon, 13 May 2024 15:31:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="cw4tRIsd" Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.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 D07ED1552E6 for ; Mon, 13 May 2024 15:31:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614299; cv=none; b=obqN7/lRgDKx+B0tVbN8Z86mgasvfYBsJPSkXMSWaLuQ74fsjvwPcZPB86kVVlDngWwBgyTxA1oGxxta5n+6ejLhSKTZqepLDMEv0Jd8OlhzTEf0JqF5lHJT2PlyA8qoLkO/BAouM+iYdQcV6kf8qzvfWJXDj3Cn6W21O/x3Cbo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614299; c=relaxed/simple; bh=wa+tJxJQlgXE02oZU23FSCgQH8hmKCXfTbUikz2I43g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GFofJHDtZOEFW1CHbf0dvgDmS36WAh6FfyRu5GDpDrKSt56FraRLOMytPL+ZtSlh2B3ImSkxgEMPnP8RTNluvJpFGQBqMKOKKvpQODCFe61dE3/Kc/pmnZbep9UCchMqI44sNiw04Lp6BlD2kANnNCFVtqsgXUHkifwwFmhlMMI= 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=cw4tRIsd; arc=none smtp.client-ip=95.215.58.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=1715614296; 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=iDFYXwTyTrz+GVTosm5TTL0X5z5slov+AkciH3erF0Y=; b=cw4tRIsdJz9b1hZUYpylnVeS3YuHdagO7osHbd96/U6R0w3jlXpGYMVZ8ET5QL0p6hWQUY V4K56+7jLQ0Hc+i5z2Kmu+hEMA6CgLc8OLZgTGCda5zmYkfGmtzdBRuVr3G6Yq+3IAdpRc LUqoYXZiY1D2ML2QT/FRax/EQfVZB5w= 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 05/12] drm/bridge: it6505: Remove a redundant check on existence of bridge->encoder Date: Mon, 13 May 2024 23:31:02 +0800 Message-ID: <20240513153109.46786-6-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 it6505_bridge_attach(), 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 it6505_bridge_attach() get called. Note that the it6505_bridge_attach() will only be called by .attach() of the previous bridge or KMS driver. The previous 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 it6505_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/ite-it6505.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c index 3f68c82888c2..469157341f3a 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2882,11 +2882,6 @@ static int it6505_bridge_attach(struct drm_bridge *bridge, return -EINVAL; } - if (!bridge->encoder) { - dev_err(dev, "Parent encoder object not found"); - return -ENODEV; - } - /* Register aux channel */ it6505->aux.drm_dev = bridge->dev; -- 2.43.0