Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1109573lqo; Sat, 11 May 2024 07:47:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWEt60UkKm5YCzNSQcFEjjZvPC59emXm/s8VEGk5/wI7HkjizoMWeXqCePzaQZqQqemJSZ8GpWqZHzQpPMDE4ZpjFkWJTgdWzRzMqdY8A== X-Google-Smtp-Source: AGHT+IGWpeKyiyHhkapW0Zbh2owSHYEyjZjZEhdugV0F0fIffO9wA3McslK1eN1z21rr5OByD9oA X-Received: by 2002:a17:903:32ce:b0:1e0:c0b9:589e with SMTP id d9443c01a7336-1eefa5746d3mr133390285ad.25.1715438857981; Sat, 11 May 2024 07:47:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715438857; cv=pass; d=google.com; s=arc-20160816; b=XWqf2K9tDZFzfQJQ5BW25CSFi8n0uPjXJB1EuPdaDtR3tnAjUCwmjJhNVjrdunXOtj r2pwR8f4WxZ/EzMxz1S+XnZd/6zQDzypkTmxdBzNMVsfsWgCCAjX6oGRslfwHV0EG07+ 7VbBFzraDtEOw3WkLMKdBaAIwTlbq5kro5WMJlorhv9rGu2LnPnRfUnd5BV8v6SbSPF9 eVWu5sXQMhGHYVPFcq4euNGWOZwlSJj932a0U1jn/XaH8La131hU3tcF53lSjKc5chJG dp6QK7It21OsP4tMsKHSgTAjB5Ou4J3Mfpyeu3EC4iCBO+DbkJP0PE+CHfn+rU4gxHhc JF5A== 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=7yOqpZKsUKDB1a0tUagb9Qur9MXv1mW2mjyu4D7NkSE=; fh=wOxYnf5cB8EXtrDPB+7Ap+AE3ORvvjAbNrmA+4qPZLg=; b=GRRKV07/OWM9ApB6LWNTaoDoepJZP/rvAtHuuNSN6y4uEcyhPkwi95nBfyLRW7ABHA 2QrXq/67xrMLNo/EKH8fT/ib/aAE2Qonj2hzrm5hG7TMTBAOf3S8uTtuuR/tNcCoGDwT GeVkZSNeMqVYqJhJ5cJkSPAgAjNYz3QIs2oEItzz73TZtkyRGvlLk86kRV15GrKZQIh/ j6Ih22Kke9VVm/eCCRKNT8/b4Yy68akbE/0DR50zFZk49iMNLWDjDez+EPGFAFHT2ASQ vm1F7nt+I5h2DWHxFAoOjhk3lg01cRSxGW9PrKXswWFOzW8vEiWC8NZ+FMYZ57cozVTT lLvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=d3yVAzsb; 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-176583-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176583-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-634103f70e7si5453937a12.291.2024.05.11.07.47.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 07:47:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176583-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=d3yVAzsb; 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-176583-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176583-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 8A807B2112E for ; Sat, 11 May 2024 14:47:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D1C755C1A; Sat, 11 May 2024 14:47:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="d3yVAzsb" Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) (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 ED38237169 for ; Sat, 11 May 2024 14:47:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715438847; cv=none; b=WPqL6I8S6ZjMRXAjXw1L4bhKdqUE4drgM9Ag9UjiaOMomC+GbB/LR06XVrnOHBjMNAxUiefn11/HvXFemwTATIXEbqevT3mGhxgr8+FTeY0O98Ab6opJazlSHWfykV/irq+T4pYuOhqCguCyG4nbo33nCEu36N+7EBHs9h4MkYg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715438847; c=relaxed/simple; bh=Fx28MQST8ByqGaLf3JVQVmXNpCZ5f7j41vlyIHTb58E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Vc1/ugKRTqfB6qn40Q/7ZQLnwUqG6MxzNpTDZtTqY93zJ0JoSGZdHixEZ8lTplYChNtwIi94U6JjQE5WfVs246OsgwRoyNs61Ou2w4P73jNzXqMq0jWjMLhrT4DPdTgjaD2jok38w2CSlTdJlCxgDPds4WGXTzdsLV/zSZPHLds= 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=d3yVAzsb; arc=none smtp.client-ip=91.218.175.179 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=1715438843; 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=7yOqpZKsUKDB1a0tUagb9Qur9MXv1mW2mjyu4D7NkSE=; b=d3yVAzsbzdpSfkT78RVPvEMqZ/aV+HAl9d9PnPMHjixfIjK6vovt1sjtxrjX2d616YAyM5 ADA3b26o/ZqjrQrx87t3Y+jmSJKtvpgShsFqrIbQ/zGiv41dlCNZieyMLFQyGjbiPzsav2 LyALftzDxf8kQ08yANNcgXO61YsNT0k= 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: synopsys: dw-mipi-dsi: Remove a redundant check on existence of bridge->encoder Date: Sat, 11 May 2024 22:47:13 +0800 Message-ID: <20240511144713.325156-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 dw_mipi_dsi_bridge_attach() function, the check on the existence of bridge->encoder is not necessary, as it has already been done in the drm_bridge_attach() function. And the check on the drm bridge core happens before check in the implementation. Hence, it is guaranteed that the .encoder member of the struct drm_bridge is not NULL when dw_mipi_dsi_bridge_attach() function gets called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 824fb3c65742..c4e9d96933dc 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -1071,11 +1071,6 @@ static int dw_mipi_dsi_bridge_attach(struct drm_bridge *bridge, { struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge); - if (!bridge->encoder) { - DRM_ERROR("Parent encoder object not found\n"); - return -ENODEV; - } - /* Set the encoder type as caller does not know it */ bridge->encoder->encoder_type = DRM_MODE_ENCODER_DSI; -- 2.43.0