Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2127665lqo; Mon, 13 May 2024 08:33:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUPMwWjAZvBUJTNcZynpz2jxOMxkIANQLdtQvA2+t4fwOhCJNV16sEuVrHzzA+4m8dunlAp7xIH5Dvd2fe3KAM+pMIVmHzXHhJSKI+VYg== X-Google-Smtp-Source: AGHT+IEzPoP7bgahoyPnCzLXJWcc0N8ilyBLiRbxGOjRQM8/Qx5c0X/ypVf8+cbbfnWJIJ/ZkwrI X-Received: by 2002:a17:902:728c:b0:1ec:31f5:16d5 with SMTP id d9443c01a7336-1ef43f2c758mr83987885ad.33.1715614386238; Mon, 13 May 2024 08:33:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715614386; cv=pass; d=google.com; s=arc-20160816; b=AcVpgEsgTysQZXiggiB4yMMuM1A9WNNqFA87J7YhkTwPQwtGr2BMNxGUKpVpoyoe6F hCDh2j4LRr+PZxfab3A6cpf8JyNOp3NcQC9SJyut2sswUDD/NHAuZp84EcXO1tbyawTN v0Fxlxfb1NDVUSl6iuRkB3YOlBsvC+o4BHtml4bLHt4/EZlRHLdUYYtWPW/zGPEhpIKD k0CbDfNrW70RLYeKnsd9wGnC4CdC6uPQB46KV/epXgC5yAjcHX/TuUfR6i9z0b3Eq/SI dPrcmS/G6X+Vf+qUeygXXNORbKe8Vm4Zl/hm4Bnhc15Ruhc4kmHyHcCYVL4OYrq28PRr X4cA== 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=VmmG+selwisq3Cij6Bl0HRC/hX07+VfIYU4xEOfZWQk=; fh=YtI1unxrdsy37CaPN2XWjLZc9EMsMnSRizG41qMMsuU=; b=yNrhieCh+1jegtZqbby2Vq/HfNhzMu0kGqGbEyErrvYSozWS57hfX1z4dz2qW4ueom k1JtlskSOHd2Zu8wdK8m5x2z21Z+OeFaJdYPavjfcXc8aCguUMyMCy5OZK0Ev9ZxaHSd dmnOSmnxhfi7vVZrT2c6NJbTI6AEdWECZzx5Wi1cC43ztq/l6GbP3dImDQywycx6tAV/ qnjqJqGLrQhyW2+b2kEuRKpGgjUdjEkp0Z2DoaO4tHuRNbfzUziewWa5zeOWD/mYwpbY hkYesnxqAqESAqezf+LL3eV/hvLPfzzHksc9kNoi/tCqUQOAXxDUcpmS4LId+fUrQ2zP NAaQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=B+TFeV5u; 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-177753-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177753-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0b9d144dsi94794945ad.84.2024.05.13.08.33.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 08:33:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177753-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=B+TFeV5u; 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-177753-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177753-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 F128E28207A for ; Mon, 13 May 2024 15:32:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95A85155331; Mon, 13 May 2024 15:31:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="B+TFeV5u" Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [95.215.58.170]) (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 1EAA7155316 for ; Mon, 13 May 2024 15:31:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614306; cv=none; b=rdyc4cRTH5Z5bfNJUQwIRByFfyE4S+OEZSTaEeZ1O4yRoRaSP9Qut5ayk1UZsmc+JFOn4amzPgH554cgVIuuYICyFWMR+We7jZA3briZnGZSRUeYMuoEZHMEn+cpXT6FdSktoMxFkPG5Rum0qBSvMKfwYSri4ri93QQNlhzeV+k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614306; c=relaxed/simple; bh=PgpXnnsEU3a+phmsrJGk4HFEBOrA+xosJkYR3/+m+kw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LCp8smSzkjLa2tFoX65cYDcsQiEVo3+VvSmkOI5y7GSg4JVodsSbSsa+5wOAOsJDmBGE5D1E43h9AX6GRjedXaOY4p9MkES1kCJlxjhsqMtCXMMKl0JamjiFICWv36Ry6B8JU7PaRVzFiGB1hAmZDsNLSGBV5GVDq7i3w/5imyU= 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=B+TFeV5u; arc=none smtp.client-ip=95.215.58.170 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=1715614302; 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=VmmG+selwisq3Cij6Bl0HRC/hX07+VfIYU4xEOfZWQk=; b=B+TFeV5uri4dtgTs4C+zx/xC/D9sFg7q4eP6p16rzZMpdkuMD7H8X1y8GB+xwdtetfkrml 2Xt0NKME0G0EPA38KadDthNWKq0ZtEPyxk5stQgR2Gls97xDiw4mJLj67BKxn1fRSNpKni f2tQuC/E0wAkGeChoLmKacQdST0RU+I= 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 07/12] drm/bridge: cdns-mhdp8546: Remove a redundant check on existence of bridge->encoder Date: Mon, 13 May 2024 23:31:04 +0800 Message-ID: <20240513153109.46786-8-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 the cdns_mhdp_connector_init() function, the check on the existence of bridge->encoder is not necessary, as it has already been checked in the drm_bridge_attach() function. As the cdns_mhdp_connector_init() is only called by cdns_mhdp_attach(), it is guaranteed that the .encoder member of the struct drm_bridge is not NULL when cdns_mhdp_attach() gets called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Reviewed-by: Laurent Pinchart Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index 8a91ef0ae065..dee640ab1d3a 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -1697,11 +1697,6 @@ static int cdns_mhdp_connector_init(struct cdns_mhdp_device *mhdp) struct drm_bridge *bridge = &mhdp->bridge; int ret; - if (!bridge->encoder) { - dev_err(mhdp->dev, "Parent encoder object not found"); - return -ENODEV; - } - conn->polled = DRM_CONNECTOR_POLL_HPD; ret = drm_connector_init(bridge->dev, conn, &cdns_mhdp_conn_funcs, -- 2.43.0