Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1100208lqo; Sat, 11 May 2024 07:23:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVLz67G9Z0wsYz0Odch+pPv/oUcbw2ftOkkAhslkRwnmfYHsvWsaNH/sY1iCjVBfxzi0LL0+2ToIbUXoXn0OmYy37v5Zf0wKa4Yc+r/GQ== X-Google-Smtp-Source: AGHT+IFxI4dvpR9DRJyvEIkzncIlZuNSEw+v6+/y1UYN17qYAubbRCegxkH5C26YN31LNcDNNGci X-Received: by 2002:a05:6a20:dd9e:b0:1af:a86b:106d with SMTP id adf61e73a8af0-1afde0a99f1mr6268852637.7.1715437420159; Sat, 11 May 2024 07:23:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715437420; cv=pass; d=google.com; s=arc-20160816; b=es5BHf5ImKVqPEk8a16yCIRgcBkj1mxRqdk/qAlMeFie/7Jiab6HSRIFFQgPncs+yc C5NwJDpCUZu29IWbZ9WCFBFpO31EZ6bcSFTdutdo0e68OLIbt23Dfv8Yg6pXM6emOXvA f70pbJQirnzSrDI0KKS+NUkO7CiPyC9FxhYuuZniYpU4CMYKo8qVURUE4QrSa8yhxeJJ HB5XdEIzth0u74SqmkrDGloX2l/71+amcOEFAsw5erqa1zBPEaJBKF9qb6+kWQHYTd/C V0CQueTwjOJDb8nWtFAPXNJ5OzIHbxOKNk1+ChV6CWDjps0oEF2eBKvqRxlYKq+KVsXc R3aA== 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=zcYhP9OjsZHGRPynpEjy4cHU+TvGSKNPfAx6ChvpYtU=; fh=wOxYnf5cB8EXtrDPB+7Ap+AE3ORvvjAbNrmA+4qPZLg=; b=kll8kMrUv1mmqRp18S2QcXdRBUf/YJlG14pobIEbS8Dvd92LYMaqPvQoM7gqfcfUd4 yjwi4i8i09yuMjd93Jc4S8nXKDB7A5FYVQ5XuIl8MGzp6dSOiF/2Lb8f8yLKoQ8d4LbH 4ghzhs8bCvoJ8dtq6rdl8tAax9bZuwrr3ANpzs/FAxjP+mkd5HsjONbQJVJjYuExBhZj 5DcrAfJ4LiPGCwT6ytV3Xvb4W+tMAOXY31+1m3d+s8O7gwziA1BAB/ezrnyqv3zk8dkC dryUtUcqIr+ZTAb1qBuGIIWlNTGVRTSRqag/0W9WfH7q+ikVWrCA1Q77xaGeHg3wyXc4 +xZA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="oh3oh/Uv"; 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-176575-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176575-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-6f4d2a72360si6236697b3a.66.2024.05.11.07.23.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 07:23:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176575-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="oh3oh/Uv"; 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-176575-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176575-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 C55B32820AB for ; Sat, 11 May 2024 14:23:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7782F54665; Sat, 11 May 2024 14:23:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="oh3oh/Uv" Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (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 C2C9F5674D for ; Sat, 11 May 2024 14:23:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715437398; cv=none; b=heeUa2oTwIEHP+1ivR/r1bKxI5B5xxXIw0lfrSQRj4KALA1d7u8gRMqfHcfE0H5WGkxhjTI7E6BwbDdx+Ro1WPwu2MHFxKGbd+wZfJZLhxy0WcFvoBFKQ6o68X4XFHrwPyVrzLYBzo9lrKENWuiHtT0HYQpXloUks0RwDlc7uVY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715437398; c=relaxed/simple; bh=c7fqYBpE6QvcP0bozISJLly85HHN5z+I+0WYEQzIpt0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=q3M4ou9sFC6EDg9iCaEsE9bQMQM362KGOASIJtdyKO0AqtLcKcE2+C8Zr0blFHUWgCb84VaBgiup8R8rZWUPiXzVUOSFcKYq/wIIu2XDSlOiAs9pL3cqD8XejpLV/SECB9l8hZXtYZp/hDanfclJwu/vT58yHK483C8rScucI0c= 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=oh3oh/Uv; arc=none smtp.client-ip=91.218.175.183 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=1715437394; 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=zcYhP9OjsZHGRPynpEjy4cHU+TvGSKNPfAx6ChvpYtU=; b=oh3oh/UvEZf9JxPeVrdZ69ZtvLqamC5Pm46sS650b3AqCwuqXt1Jk9Uwfz/bpMkH93VS2E lhy9bF+FNiwa0GGlre15fkSw/jKqkOiLkuBNbROyBZX/fceJkFHzdcq3uBGgvNtlahmKab 04/wkN0zlowYz1seGuhBL+mM5JhKoTs= 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: adv7511: Remove a redundant check on existence of bridge->encoder Date: Sat, 11 May 2024 22:23:08 +0800 Message-ID: <20240511142308.319541-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 adv7511_connector_init() 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 adv7511_bridge_attach() function is called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index b5518ff97165..1a0e614e0fd3 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -871,11 +871,6 @@ static int adv7511_connector_init(struct adv7511 *adv) struct drm_bridge *bridge = &adv->bridge; int ret; - if (!bridge->encoder) { - DRM_ERROR("Parent encoder object not found"); - return -ENODEV; - } - if (adv->i2c_main->irq) adv->connector.polled = DRM_CONNECTOR_POLL_HPD; else -- 2.43.0