Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2128008lqo; Mon, 13 May 2024 08:33:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXE3SU6TXHV+sYM3h3r58kxWUf/HMRw7MGcGIBTel8y8Qf3jhVziC2QGwCR/cN0XCHe3bEiqBTKsAA8b6YoiBbpUmeGNGzIRuAH7CJ7bg== X-Google-Smtp-Source: AGHT+IECSk0g/TRU2hWtZdeg++xFA15802Mu1JGzIih5gK523P8yE3GzWbPzWTv6t+STQBb18ggz X-Received: by 2002:a05:6808:19a8:b0:3c9:69f2:749c with SMTP id 5614622812f47-3c9970698b8mr13985050b6e.24.1715614414308; Mon, 13 May 2024 08:33:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715614414; cv=pass; d=google.com; s=arc-20160816; b=WeJyJ4jeYAdInwQtBQDOA/w1gfUcda1CNInKtsUldngmfY5liiL5iuMDYLqytL0C2y QRS8eWebGSty4PZmC6ZHPET4ARKq3VbQkuUU7/YfqpfPsv3Y4sj3ZJO25sTksJQrMZyt +Js7+VeMr70/Uk+tlH68J5ptsR3dutyaEvMLjLBHaBdgxF17T8fd14W9tPyKm6TqvCda 3cF1LbgxLFmGr61BFmFsZfRzeLktWOwy3tGZygqMxr12RkRxN9wWjSJ7JkNWsnmL7Ofb e5c353GlPwOdWC2HcT//gHbw7I0oa6yjtUyANF7GFqSX1TkRhbQ8ikXzJMQIofFTZDaL gcZQ== 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=fieuYk+nURcP7QzRErE1UcUcoViv3rOVeaNarCw66hk=; fh=YtI1unxrdsy37CaPN2XWjLZc9EMsMnSRizG41qMMsuU=; b=hJq2pdf+eBazsi2YQeY8o4TZyEo7yvduvMC4d4aXv1CjmGeh0KpvleryUQG80SczTi DK2AAJ0MSopORkX72JdG6KT3IW+y5w5daTq/g32XALX8wdk9K2mTSW96eBitgCN5Zva0 BBKHvfWsnK1M/aJi9igGxJT5N0E3rgKe1bsbHec0Kysh0q8iPg5iaKMwQYLQxG60sNpX zXFkD62VL3IBniHdmT3Nq5sXy5SWUCoYfGTn+EOgDiEn80qOO78QuZGXOlqYqDWQJzsk BqqxDS3OzyWxWlF87OBQhyp/w6iQrCkD+TSYSlNGDxIUG7sT0qDqMA0bnXP88PuMAVhN OzqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=bq1IkHpU; 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-177749-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177749-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 ada2fe7eead31-481f0a21089si400037137.335.2024.05.13.08.33.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 08:33:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177749-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=bq1IkHpU; 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-177749-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177749-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 A16581C23305 for ; Mon, 13 May 2024 15:32:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E6C514F103; Mon, 13 May 2024 15:31:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="bq1IkHpU" Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [95.215.58.182]) (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 2C50E15444E for ; Mon, 13 May 2024 15:31:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614292; cv=none; b=K5T1WCGzBbI+jocbYNs0JNX+3Cru5OzKv6BT+aTpm9jrhrxW9BvN3oYsfO6wV4+BxgqqUuGB4RVuwh2eGK6X1g7H0v56AwyEorqWAjyM1BVBi7AprNO9AA1BgIQcPsLikW4Tynvxa33KNDD1+BkY02Jv2j3Bi1VV41BFUsP9Iu0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614292; c=relaxed/simple; bh=3pIkhFZutgRbunZ+6pvSexYNkmFQyMQV3MN2fvC5RqA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=twW4hpf/DiwLz8Y2e2jvApdvCrtqNvlExsrY+ABSM20+SQy91QJ80PZDyrDITyoSpRl8SQDREZq0s2/0VjyCpKigeM0E/aUuKofPNBJByhrhNszaaLo/S/7xljFTAmgZiiBg7S4NPZ7uyRg2TMbHuMBT8Yo37tS3Yabwq8YOtqY= 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=bq1IkHpU; arc=none smtp.client-ip=95.215.58.182 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=1715614289; 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=fieuYk+nURcP7QzRErE1UcUcoViv3rOVeaNarCw66hk=; b=bq1IkHpUh3PVQqMCH65q9MHUERq13wniLIxTv634zzNyy189ZqQdXuT9FLRwNpt+pksh0A ILgI/8m83EnRIHiJNgd1pWUIs5m35IGlPiH7AZVdD3wYwmrVnmlRtopWdQcgq0WyJZuDGL y+KISuWRztOl1y5CmjgADb2YqJkzNQY= 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 03/12] drm/bridge: nxp-ptn3460: Remove a redundant check on existence of bridge->encoder Date: Mon, 13 May 2024 23:31:00 +0800 Message-ID: <20240513153109.46786-4-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 ptn3460_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 ptn3460_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/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