Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1094024lqo; Sat, 11 May 2024 07:11:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMtxysvZA5PSaJeNTSn3NEk11fk5SfxVkSVJ/7qkYfxQNiTO1S90hWk0cNa49RfLdAhN4AzhEnZI9Ooq2d2dIIOFM70/lhub3QIZpbBg== X-Google-Smtp-Source: AGHT+IGm//15B0CM2u1Du18k7bKA3+pYJPScMsvmsgpusg1PrmUv44L53r0TypmaALV8ZQ97gARm X-Received: by 2002:a05:6214:5241:b0:6a0:dda7:744f with SMTP id 6a1803df08f44-6a1681e0e94mr63226766d6.37.1715436674423; Sat, 11 May 2024 07:11:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715436674; cv=pass; d=google.com; s=arc-20160816; b=M+ZVSknaZHweKNjQoMZSqVSbJz9pXqMMkoWsNeZ6t6kUq73hnspV0xhZPqlMns7CAa qY+4bJkbd9s0S1A3z068eINdrz1SB+83gcTZny041aXS/I0q9EisT9p8VmjNlV+O3uhH auEGLCDqRIXFalft0vS90Fpvw9ikuOt92o/X/11AfSONegVIKabevOff5mSk+YYHuJse EXZA9Ax1ujwmsqzRcckpF2wWs1aNCqW4FY0qKzfcJmHsZlGpQqU7UTwFIn4MBLAAVZdO AaGxomFPHP6tPiQrDZ8o+HK2oaraw7UxEySlTQxjw744gkRzCs8bR8nZdDPFN3bV+AHT y8JA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=a8dPyaiCOoPY+Q3gecWjt41rdV234ZLMDok9YAx2su8=; fh=wOxYnf5cB8EXtrDPB+7Ap+AE3ORvvjAbNrmA+4qPZLg=; b=OWs+SeJ1e92uFngkwCV2+1dPnjLRfyZHlcotMTMn8AhTs0qSVVs7+g0SRgFusJjFt2 5HGFAFZ92SOniG06pTTdPkHeExevcV+ZYbFPRC1SxrxoTV6l7Rq4v6o5LhS00NTT2vYS MTsnNkARcJSK36pAa9GKgR4E78ATW/W4ypzsL5aL9OCVJTzbfFf8GmGL+FqOGuxIMHmr fPqnZk7ijKl2G4Q0IsiqRAmS84vjfxgEfi4b+Ua1aNs8NHRAcfaaW8j8u0+HhbHVnUNI rZ0P9iMB4JUZeQ3t0do3IukScGE4xvfUmrGpxKxtEceshv/482j47lJZmqoS7qx7ILog t+RA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="M/Vq35uZ"; 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-176569-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176569-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 6a1803df08f44-6a15f209d4fsi60535766d6.163.2024.05.11.07.11.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 07:11:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176569-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="M/Vq35uZ"; 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-176569-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176569-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 1670E1C20C43 for ; Sat, 11 May 2024 14:11:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2059D535D9; Sat, 11 May 2024 14:11:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="M/Vq35uZ" Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) (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 9159B51034 for ; Sat, 11 May 2024 14:11:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715436669; cv=none; b=KIL5rbz+Ewo2ByNSVVAYPKnX2xr0K5cUnTAac4SYxMv3mxIzTPTZsj8aNl9wObTAfbB5h6DcAcZxfMHe5T7lUYZUOP52xGQsyYC8UFr274NHXaZ8Q3kc+1CUlRa7Y/musHVv9Sziby3KOwkz86dbeFc4nTLgaXiZ4Su4t/VSn5Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715436669; c=relaxed/simple; bh=SClFnaNaoUPwOLdLRJZQWQoVTWwBBrMs120hgkj+3CM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gmr534ypEjokRcPy0nrmrT0xZc7S+aGkCSEYj3eilyQnxQDf7xpWaBypUt3dpce2l7CsTJUDk1pX3+u/V9KHtH6xn8sYc/nn5Lc3ess5JqIIl4sgWgfMB1YCFH7bi4y0tV/Z6Dp9H+g/2oBT2hShKhD2C8MnY226V671bLlcXJM= 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=M/Vq35uZ; arc=none smtp.client-ip=91.218.175.188 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=1715436664; 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; bh=a8dPyaiCOoPY+Q3gecWjt41rdV234ZLMDok9YAx2su8=; b=M/Vq35uZifBgcnTC/F4xsKyYQDfznva+NcK89//UhM+bURMQYzJ7aA92POckzjBp8cNQjZ UTw51PJgIczbbzktCRAQpzXbG4gTEQbjKtoKWIJKOf2KdIsop22c5I1QQJZen2WDaHyNEI dbYZVXTIjyiIQ8Ofv7YSaM3RAVI9ExY= From: Sui Jingfeng To: Maxime Ripard Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sui Jingfeng Subject: [PATCH] drm/bridge: it6505: Remove a redundant check on existence of bridge->encoder Date: Sat, 11 May 2024 22:10:56 +0800 Message-ID: <20240511141056.318679-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 has already been done in the implementation of drm_bridge_attach(). And it is done before the bridge->funcs->attach function hook is called. Hence, it is guaranteed that the .encoder member of the struct drm_bridge is not NULL when the panel_bridge_attach() is called. There is no need to check the existence of bridge->encoder another time, remove the redundant checking codes "if (!bridge->encoder) { ... }". 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 27334173e911..494030a75dba 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2881,11 +2881,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