Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1119800lqo; Sat, 11 May 2024 08:08:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWTlr2A65knA6qR+eBd5GBQeouFTeuKbeAdPPRHbe3zjvpqO2IoAXaQK3ijuQuJEy9EM1MaBESa8D7Mzpm9Iip7dnL88u6l937lgKbdFA== X-Google-Smtp-Source: AGHT+IGDiu0d5LASSPAC7xjPnsE7W1I6KzyuTxMLSZu2OuU6u6aQjPW29WkdST1KgrVfC0i1l/nO X-Received: by 2002:a05:6a20:dd82:b0:1af:64fb:a04c with SMTP id adf61e73a8af0-1afde10f20bmr5806098637.34.1715440118831; Sat, 11 May 2024 08:08:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715440118; cv=pass; d=google.com; s=arc-20160816; b=StbPqwfQpLlSvr6rKYfMPF0r6chRvVrO6Emuw8PsURDySo+a1OtiCe6GPK0UbH3s/A v7XKo/NrCmlA/b3Ee8ekuCpYQngfHoqbBnm6uP+GakKfcUf2VjtFOwea4fHKrgZLz2gN ItCkJAxw8AIqDloRgnLpfGITG+1PDRytFHeAFSik8Yq/J7hJThv3RKHbbVFluwpCgx2N R0SEBotu4DNhOT2uA+mIry0zdLCse87yX61YqC+3HTYpynvZM+JQnBnjmp8JqAP6KSfl pdJuo9h/frdZhM+/6bL6OCS2qdgAq6+BAy7BTuhZGXm5tjtO7CNg4+6I1pwxhDA7sumE E9xA== 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=BrwfjmHQzRbVwVRIA4mdb2bxyIDiwh21dDndDJSDjI4=; fh=OkNZeir/xWve8y9FAg+itDP4Ou0G0ne9SLhiRR2/jHQ=; b=AsIIaJCx77j0s5c0mcU6yEGJMv9W/uIXW1eUJVJh3hhd5qtfat+9s3/L39RMEb496E hAwb3iXndtKj13zB4D3E79gSSi1k6ENuYov4onsnozVi7G3K7UzMaS7p5yfUSnu94ONt d2fCnSMH71tm958O/Q6YB48nFzfH+m8wMMI0Fl1fWsImYV2RosWoh2uukbHUidWeSWRQ TPXJw5gjWh3A9dpaCzBZbZX8yZrg4br91tdm1oV+j/dLHw9gjSOYW7pkMvuHrfODfh2o +1B605iM3G66+rBSqWkRMN4k+xT2xum/jaGDSDSXJ9hWCH3hk5aXOSGp0j9qxeXdQvXl 2w8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=KbRZWvpc; 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-176595-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176595-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2b198c4si5869493b3a.268.2024.05.11.08.08.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 08:08:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176595-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=KbRZWvpc; 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-176595-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176595-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 53DEB281F19 for ; Sat, 11 May 2024 15:08:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1750955E73; Sat, 11 May 2024 15:08:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="KbRZWvpc" Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (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 9A4F848CF2 for ; Sat, 11 May 2024 15:08:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715440112; cv=none; b=MoDzkDccp9H81ceP9vuhtfffOEHmaq3pi92kEYMNBd5UbbiMevGkCz+ceY8dNiT95njiWy74jbHKcsbkILoGr0iNn4bhuLsww44/6G5IvVzroG/3EsJJjDuPEf+6BQq+XXwRCAV4bkvqP3IbEi6DDmZjXWGzAXJDDCzhZcK6xRw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715440112; c=relaxed/simple; bh=RYj3TTTlTNfkUVTE8K67/1ae2C7lkXZqTTa6meorXEI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Dj7GyPVuR9efMreJ+KcDkRpSBheQXgWWWXr/cH5ZqhwR3YTpXeuvs0ywQzBxhFEs4m5J9ORNl0QzKAQOP+kbN8/762e+yjgmOIxkjEjY9N0Di9IX8uRM08QAJjE4Otif4wTUAyASd/ZJFYI0ikeD9sUBSIuLc/ArHJPbWsI6iOk= 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=KbRZWvpc; arc=none smtp.client-ip=95.215.58.186 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=1715440107; 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=BrwfjmHQzRbVwVRIA4mdb2bxyIDiwh21dDndDJSDjI4=; b=KbRZWvpcq2OrkrvxekTl+Uh8I+6BKMZ1Ekcu1hlSayRkYu0rdB2Q1Xf5nKS+eU1mI/hbw0 d2nb9H6HZf+Ij4W+t/apgT8Gj1889aDvLXsNJySANuA+5G3hzkCDlH1hyulxbmzkwBh5BM ro5xjYtalztTMVOMVjULykhw3L6jMO8= From: Sui Jingfeng To: Liu Ying , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Pengutronix Kernel Team , Maxime Ripard , 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: imx: Remove redundant checks on existence of bridge->encoder Date: Sat, 11 May 2024 23:08:16 +0800 Message-ID: <20240511150816.326846-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 The check on the existence of bridge->encoder on the implementation layer of drm bridge driver is not necessary, as it has already been done in the drm_bridge_attach() function. It is guaranteed that the .encoder member of the drm_bridge instance is not NULL when various imx_xxx_bridge_attach() function gets called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/imx/imx-ldb-helper.c | 5 ----- drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c | 5 ----- drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c | 5 ----- drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c | 5 ----- 4 files changed, 20 deletions(-) diff --git a/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c b/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c index 6967325cd8ee..9b5bebbe357d 100644 --- a/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c +++ b/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c @@ -116,11 +116,6 @@ int ldb_bridge_attach_helper(struct drm_bridge *bridge, return -EINVAL; } - if (!bridge->encoder) { - DRM_DEV_ERROR(ldb->dev, "missing encoder\n"); - return -ENODEV; - } - return drm_bridge_attach(bridge->encoder, ldb_ch->next_bridge, bridge, DRM_BRIDGE_ATTACH_NO_CONNECTOR); diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c index d0868a6ac6c9..e6dbbdc87ce2 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c @@ -119,11 +119,6 @@ static int imx8qxp_pc_bridge_attach(struct drm_bridge *bridge, return -EINVAL; } - if (!bridge->encoder) { - DRM_DEV_ERROR(pc->dev, "missing encoder\n"); - return -ENODEV; - } - return drm_bridge_attach(bridge->encoder, ch->next_bridge, bridge, DRM_BRIDGE_ATTACH_NO_CONNECTOR); diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c index ed8b7a4e0e11..1d11cc1df43c 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c @@ -138,11 +138,6 @@ static int imx8qxp_pixel_link_bridge_attach(struct drm_bridge *bridge, return -EINVAL; } - if (!bridge->encoder) { - DRM_DEV_ERROR(pl->dev, "missing encoder\n"); - return -ENODEV; - } - return drm_bridge_attach(bridge->encoder, pl->next_bridge, bridge, DRM_BRIDGE_ATTACH_NO_CONNECTOR); diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c index 4a886cb808ca..fb7cf4369bb8 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c @@ -58,11 +58,6 @@ static int imx8qxp_pxl2dpi_bridge_attach(struct drm_bridge *bridge, return -EINVAL; } - if (!bridge->encoder) { - DRM_DEV_ERROR(p2d->dev, "missing encoder\n"); - return -ENODEV; - } - return drm_bridge_attach(bridge->encoder, p2d->next_bridge, bridge, DRM_BRIDGE_ATTACH_NO_CONNECTOR); -- 2.43.0