Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1103159lqo; Sat, 11 May 2024 07:30:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXvGmIWWlUtCbq4MuFIFCKtexeBO3iluiodwlp3QQNoRe3ltYjqujd3xRPLx/btyWCLB3uGAx+xph7xAjCp94YxbWclfdvN6EJ3O7mpgw== X-Google-Smtp-Source: AGHT+IFrwXU9i8HDo0lF6g3wxTQVqkvtJA2cG6+zt1VMpqYATwoOenCJ0rhHbGA8hN5rowIxZqHO X-Received: by 2002:a05:6358:8416:b0:18e:a0ce:a35c with SMTP id e5c5f4694b2df-193bb62f213mr691389555d.14.1715437844273; Sat, 11 May 2024 07:30:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715437844; cv=pass; d=google.com; s=arc-20160816; b=SskCouIYy2IkyjcCeIOMaSaEGDGCMLp46FZ9toou9q3xnQ8quQIkl8YnzMFIwkFGps 7kf2fOWDBmDQWvRMhUuo/Jaasv7DDfKkp+kHZcWCkImcbLqcv001dZOnLeTCYP1uCHVs WFv7DHJGjz8g0DYpdw1LJU4bOE3jeXFSnFlNTYPxR9udlrGwfZ7yPDA/a9QGav75fCk6 ZX+70UghWBsn6WC7mY2qtSo4He9edWbtAtpUOnVaVmq3fpspBLLjykzaVKF4cKmGyJmu wF1X3+glhh9DCpPnbRec3NVKoCb5hUysu0Pq2F56TDlv4UXylniaCSt/ki5Porrn65DF 8u5w== 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=8lCE5BMQPZQrEu+DdqUQa+ciyt6sV2leU46hmIRgywE=; fh=wOxYnf5cB8EXtrDPB+7Ap+AE3ORvvjAbNrmA+4qPZLg=; b=AeTSsMhbzw9ccpS9udPT88tBVl7FbMYSmAIgDm+H7ApwKcTwncYOrfHyYIQzAy1JK0 /O/X4oCohtDitqhoKQrypV3C7kh+Om0DervGrqjAWTJGPfvsmWvcBX/jo9H8orB6f0MN xLRBD/z67P3/kAwcVRw/LwNn7GFNAq3ygwFT1FRziWuBI5WHQ/6mInZka9QoACK4cPnz NgwW5aUu4nEM18HSLq6LSginhID4chrvetDEqYlWJjmRV1+zzQHuIGYpg5kYQO7qD9ME aCF9PvnHOEs2+BEgNjRsCfkd3OLAp1HU7z84Rpg5IKHnfjwifIcn3yE0FoxhBqu975Is Vb0Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=bceFpgC6; 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-176578-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176578-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 41be03b00d2f7-634103f7123si5718450a12.319.2024.05.11.07.30.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 07:30:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176578-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=bceFpgC6; 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-176578-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176578-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 DC7A5282005 for ; Sat, 11 May 2024 14:30:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E76CC55E45; Sat, 11 May 2024 14:30:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="bceFpgC6" 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 6E60079DC for ; Sat, 11 May 2024 14:30:36 +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=1715437838; cv=none; b=Y0Cftuu/xUzav5n1dWr4ZUbVjdt+ir5CI8B2g1EOeGW9NlfzEHwDyyfsDHFG4kUxIiL25m9L2igIiqvAtLUfANWUQq16KAgSupijZt12AMzl9dn5fMoyfFSNlS+pAfnl9f/MHBi6l8UMqtcMZAouXcf5ulaNnxDTC8w9R0naQKc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715437838; c=relaxed/simple; bh=6JX9U5QXTQM+ymSkQwIVScF/Sz2ugLRJCrrSvRtA14Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jnFyyJ/+yzS4CHbhKsuGuFASK45ek4NyvDmion8FTqHVfd9pnrRANSErGZSAsQMCRSKcR2v7gicjpJll9xfjYp94jdSONOV6mmnAsZFSJ/UEUdElbVFBrHUlyYz0/PgLIhJj8gXESQaZg6sFtdr4vcCIhCb6u644tU4My8hCsCM= 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=bceFpgC6; 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=1715437834; 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=8lCE5BMQPZQrEu+DdqUQa+ciyt6sV2leU46hmIRgywE=; b=bceFpgC62YkDbNS/v2cATnJkVcA3lhWGkOE64zqb3ABgk66VZE1un2/0/5lGMwOrHOZMML xlgBFzdKYFpXs5ZNvidF/AEFeVKT+EBD0xAsIAGY74R2Ubxdjtnx5CsjRfKjjAumwqaEhX xgU3ugvwy7yZX+bCEpvXipXhwqkqTjg= 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: cdns-mhdp8546: Remove a redundant check on existence of bridge->encoder Date: Sat, 11 May 2024 22:30:27 +0800 Message-ID: <20240511143027.320180-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 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 gets called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". 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 e226acc5c15e..16b58a7dcc54 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