From patchwork Mon May 13 15:30:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13663531 Received: from out-189.mta1.migadu.com (out-189.mta1.migadu.com [95.215.58.189]) (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 AB044153589 for ; Mon, 13 May 2024 15:31:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.189 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614286; cv=none; b=SUbfrOIX6xSHhyyEKiuFZYWyLmkjaBsbwSd+YzIuDe7UHVmFZsJZBc0plZOv1ZeNDpzLg2TVyNaJZss0Odd2E/ZR3MASD/3DyY5KS9UK1VmkrDx4MkE/QCMZc+CkjVYRhSCsTgncsmhCX8EjbQ8LlFIeLgSFVGFs4r9FRf1zcYo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614286; c=relaxed/simple; bh=l89qcY05vZBXoEEEwzVwYsUrgne6mG0qP39cHxCZ9YY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DTbPOVWgLBxR83ZDhgyUaVvfU60XEXLPQu8ihybLuQJ1qzkV2IIXHui6veoyLGtR3/9TvoEa2ttfhP5ybGdaZ+tj/pXAIi8p3D+nyR6Oov7yZ4ZEr4Gg7EVxPlEU7rS+oY7sC20IzYDf+FV6e53jrjT+pNOamxeIB5oG1oZlwAg= 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=xv2NJ8oB; arc=none smtp.client-ip=95.215.58.189 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="xv2NJ8oB" 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=1715614282; 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=WiifdoFYgTp3rVEK2qqeyz0G8r+zsR9iFqUJx/OeTgY=; b=xv2NJ8oBRndXa8ykHGEtOp3Az38+Qtnmuim843TUjh1gWieTYWz6a7OMJGYlc8wi2pYIv+ Cssj7AOECrLYKW8tryoychMlunWVtWmb/Gk5UrnSjOGQMlLDcmUjgvKF5/dAfOFKyP3GN3 sXGdeBCJWv2VOdSAh5ARWgXx27CFts8= 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 01/12] drm/bridge: simple-bridge: Remove a redundant check on existence of bridge->encoder Date: Mon, 13 May 2024 23:30:58 +0800 Message-ID: <20240513153109.46786-2-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: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Because the existence of 'bridge->encoder' has already been checked before the simple_bridge_attach() function get called, and drm_bridge_attach() will quit with a negative error code returned if it fails for some reasons. Hence, it is guaranteed that the .encoder member of the drm_bridge instance is not NULL when the simple_bridge_attach() get called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Reviewed-by: Laurent Pinchart Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/simple-bridge.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/simple-bridge.c b/drivers/gpu/drm/bridge/simple-bridge.c index 5813a2c4fc5e..2ca89f313cd1 100644 --- a/drivers/gpu/drm/bridge/simple-bridge.c +++ b/drivers/gpu/drm/bridge/simple-bridge.c @@ -116,11 +116,6 @@ static int simple_bridge_attach(struct drm_bridge *bridge, if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) return 0; - if (!bridge->encoder) { - DRM_ERROR("Missing encoder\n"); - return -ENODEV; - } - drm_connector_helper_add(&sbridge->connector, &simple_bridge_con_helper_funcs); ret = drm_connector_init_with_ddc(bridge->dev, &sbridge->connector, From patchwork Mon May 13 15:30:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13663532 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 E550815442F for ; Mon, 13 May 2024 15:31:27 +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=1715614289; cv=none; b=mEuC0fs5kCZ519BtbZiVHHCnNt9nbujHa9YMV6M8j/9CKnRNNY19Z/Z/vu8NxW+v4BSOPpkgL7eENXYiV/HcN3wARLD3QQNK7oq9Fm3+4NOEpxM5M8YIMI5a8MSqI1t6OpMDu/gMQV/w+FJ2k5nlfJDEh639NPzf9E6y1Y2LwFU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614289; c=relaxed/simple; bh=p6YXlAq5y5nroCD3axdcAiCsFuwA/e7PiPvtBxv/PWY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gwWBN+ahN1c3AEPkRtJM8STyCvzalCWVSYCkSYAl4kVg2duzIjtB22CqI/eRvMhD74+Bdu+KHxoD5gUqw9QNNUmk0BVwVXbFOXqaE7+qf912pp2Tt8eCEnlqPfP9KbF1TJXQduvGw/oBVFYaNdhFWEbXwyzERJMnsHtjv+yAyjs= 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=dQutNbbD; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="dQutNbbD" 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=1715614286; 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=4YoVt4aSJSp709BZ9Sg0TFkDLrzgxtQT0KSEfyb8RGE=; b=dQutNbbD0iwsWvTR7cYsV4k51jyQEB518S7NGrJrei0GmE8x2FDXw9Xwpe1viUxWJLfktb cCnzN5N60RHj7cODV2AHrqo2rePzXacLapXoqJhWrN/8iF80pRtK88QX2onB0zWBepOLLI 6P4szXukzBRqgTPN67witSUwmvjaWKU= 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 02/12] drm/bridge: tfp410: Remove a redundant check on existence of bridge->encoder Date: Mon, 13 May 2024 23:30:59 +0800 Message-ID: <20240513153109.46786-3-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: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Because the existence of bridge->encoder has already been checked before the simple_bridge_attach() function get called, And drm_bridge_attach() will quit with a negative error code returned if it fails for some reasons. Hence, it is guaranteed that the .encoder member of the drm_bridge instance is not NULL when the tfp410_attach() function get called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Reviewed-by: Laurent Pinchart Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/ti-tfp410.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index c7bef5c23927..b1b1e4d5a24a 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -133,11 +133,6 @@ static int tfp410_attach(struct drm_bridge *bridge, if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) return 0; - if (!bridge->encoder) { - dev_err(dvi->dev, "Missing encoder\n"); - return -ENODEV; - } - if (dvi->next_bridge->ops & DRM_BRIDGE_OP_DETECT) dvi->connector.polled = DRM_CONNECTOR_POLL_HPD; else From patchwork Mon May 13 15:31:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13663533 Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (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 08B8315444D for ; Mon, 13 May 2024 15:31:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614292; cv=none; b=EMWm62hxHp02rIbnbIl50FEZ1zx8vJcepARhYJx7v0Ck6X+HbBQ06aqq+s/kAZcwDClacUkWGYtPs6LO2c+T3Lkm9XEMvYDueJ4DMoiP7P4jgbPSdW56jSEeQxunob5CoXTxvU3l7+ChDD/k64wLtVQQLPwhktSMPwzFL7l2lP0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614292; c=relaxed/simple; bh=3pIkhFZutgRbunZ+6pvSexYNkmFQyMQV3MN2fvC5RqA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=twW4hpf/DiwLz8Y2e2jvApdvCrtqNvlExsrY+ABSM20+SQy91QJ80PZDyrDITyoSpRl8SQDREZq0s2/0VjyCpKigeM0E/aUuKofPNBJByhrhNszaaLo/S/7xljFTAmgZiiBg7S4NPZ7uyRg2TMbHuMBT8Yo37tS3Yabwq8YOtqY= 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=bq1IkHpU; arc=none smtp.client-ip=95.215.58.188 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="bq1IkHpU" 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=1715614289; 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=fieuYk+nURcP7QzRErE1UcUcoViv3rOVeaNarCw66hk=; b=bq1IkHpUh3PVQqMCH65q9MHUERq13wniLIxTv634zzNyy189ZqQdXuT9FLRwNpt+pksh0A ILgI/8m83EnRIHiJNgd1pWUIs5m35IGlPiH7AZVdD3wYwmrVnmlRtopWdQcgq0WyJZuDGL y+KISuWRztOl1y5CmjgADb2YqJkzNQY= 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 03/12] drm/bridge: nxp-ptn3460: Remove a redundant check on existence of bridge->encoder Date: Mon, 13 May 2024 23:31:00 +0800 Message-ID: <20240513153109.46786-4-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: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Because the existence of 'bridge->encoder' has already been checked before the ptn3460_bridge_attach() function get called, and drm_bridge_attach() will quit with a negative error code returned if it fails for some reasons. Hence, it is guaranteed that the .encoder member of the drm_bridge instance is not NULL when the ptn3460_bridge_attach() function get called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Reviewed-by: Laurent Pinchart Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/nxp-ptn3460.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/nxp-ptn3460.c b/drivers/gpu/drm/bridge/nxp-ptn3460.c index ed93fd4c3265..e77aab965fcf 100644 --- a/drivers/gpu/drm/bridge/nxp-ptn3460.c +++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c @@ -229,11 +229,6 @@ static int ptn3460_bridge_attach(struct drm_bridge *bridge, if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) return 0; - if (!bridge->encoder) { - DRM_ERROR("Parent encoder object not found"); - return -ENODEV; - } - ptn_bridge->connector.polled = DRM_CONNECTOR_POLL_HPD; ret = drm_connector_init(bridge->dev, &ptn_bridge->connector, &ptn3460_connector_funcs, DRM_MODE_CONNECTOR_LVDS); From patchwork Mon May 13 15:31:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13663534 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.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 03A0B154BF0 for ; Mon, 13 May 2024 15:31:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614295; cv=none; b=D7GGX3spjRl3WM7PwcjgSHxbNX8JAn/QJ0y98XP+7NJ0XCXdPlo4Rp5/+4RwQcMJYFnLTNWWHQCRcb3L4DRRbfQBbMrZZ+7K9nFz6MG0bF8L/SfQDAnM1HXUb3GNw8UAUp63gmobWGhXrpDMVruIX/di/JgGd5o+9YMqnMZRoBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614295; c=relaxed/simple; bh=dxoRAAr7aO9h0vQTtim6PDbtF3Jv9vhywmIqCc4bpYM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KB1XEvt7VBoce1YS1lrLxzBh82kegxjYzstiLB0aHfVGmubZC024FrwI+sKtwI5/d6k/AAshZYM1SbIHHhlLv/8cjJhWsTo25dSS/yysHfYWdtoClwAEJKc2By1tk5kjQ7/HTAo/lMfPr3P4RxlACusiyzTrVqV4qtMeZoirEfw= 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=CDm7CqHc; arc=none smtp.client-ip=95.215.58.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="CDm7CqHc" 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=1715614292; 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=VuurdJj3GDklou0Of2HgmHbA6rBjSJAex3DjQZYdsF0=; b=CDm7CqHceFKy5OciFO5Mvsz8tZq+kJdT2xpaNPs7kweW+u7wPvo+d1weU0CekuYKywg3bo R0B0oLhklrWIKJN2NRxFMzdNaSPA1lr8rPMjXo6JZWvMswqf+37LLuaOkopxisneLn8No1 iBo5Jq70dtVZzgMc/5dKvoPgj62qCYY= 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 04/12] drm/bridge: panel: Remove a redundant check on existence of bridge->encoder Date: Mon, 13 May 2024 23:31:01 +0800 Message-ID: <20240513153109.46786-5-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: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Because the existence of 'bridge->encoder' has already been checked before the panel_bridge_attach() function get called, and the drm_bridge_attach() will quit with a negative error code returned if it fails for some reasons. Hence, it is guaranteed that the .encoder member of the drm_bridge instance is not NULL when panel_bridge_attach() function get called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Reviewed-by: Laurent Pinchart Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/panel.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index 32506524d9a2..56c40b516a8f 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -67,11 +67,6 @@ static int panel_bridge_attach(struct drm_bridge *bridge, if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) return 0; - if (!bridge->encoder) { - DRM_ERROR("Missing encoder\n"); - return -ENODEV; - } - drm_connector_helper_add(connector, &panel_bridge_connector_helper_funcs); From patchwork Mon May 13 15:31:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13663535 Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (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 E00281552E8 for ; Mon, 13 May 2024 15:31:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614299; cv=none; b=HwUT3fwF1i8CfZDvCJKm1wq9cJwfbVeFfB/idMtk4TrPlaufQnoiLsQhBRt3wz4GbBJDkUiAU8GV3EMUKt627TTdluzbWhKNN+DMoi+rh7lr+cw5LYLU/nQyLzytsH2fyhNJ4r7dKwl3J6xAQVvGfq7MPd57wd0p6r5AUZdflik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614299; c=relaxed/simple; bh=wa+tJxJQlgXE02oZU23FSCgQH8hmKCXfTbUikz2I43g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GFofJHDtZOEFW1CHbf0dvgDmS36WAh6FfyRu5GDpDrKSt56FraRLOMytPL+ZtSlh2B3ImSkxgEMPnP8RTNluvJpFGQBqMKOKKvpQODCFe61dE3/Kc/pmnZbep9UCchMqI44sNiw04Lp6BlD2kANnNCFVtqsgXUHkifwwFmhlMMI= 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=cw4tRIsd; arc=none smtp.client-ip=95.215.58.174 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="cw4tRIsd" 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=1715614296; 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=iDFYXwTyTrz+GVTosm5TTL0X5z5slov+AkciH3erF0Y=; b=cw4tRIsdJz9b1hZUYpylnVeS3YuHdagO7osHbd96/U6R0w3jlXpGYMVZ8ET5QL0p6hWQUY V4K56+7jLQ0Hc+i5z2Kmu+hEMA6CgLc8OLZgTGCda5zmYkfGmtzdBRuVr3G6Yq+3IAdpRc LUqoYXZiY1D2ML2QT/FRax/EQfVZB5w= 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 05/12] drm/bridge: it6505: Remove a redundant check on existence of bridge->encoder Date: Mon, 13 May 2024 23:31:02 +0800 Message-ID: <20240513153109.46786-6-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: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT In it6505_bridge_attach(), the check on the existence of 'bridge->encoder' is not necessary, as it has already been checked in the drm_bridge_attach() which happens prior to it6505_bridge_attach() get called. Note that the it6505_bridge_attach() will only be called by .attach() of the previous bridge or KMS driver. The previous drm_bridge_attach() will quit with a negative error code returned if it fails for some reasons. Hence, it is guaranteed that the .encoder member of the drm_bridge instance is not NULL when it6505_bridge_attach() function get called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Reviewed-by: Laurent Pinchart Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/ite-it6505.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c index 3f68c82888c2..469157341f3a 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2882,11 +2882,6 @@ static int it6505_bridge_attach(struct drm_bridge *bridge, return -EINVAL; } - if (!bridge->encoder) { - dev_err(dev, "Parent encoder object not found"); - return -ENODEV; - } - /* Register aux channel */ it6505->aux.drm_dev = bridge->dev; From patchwork Mon May 13 15:31:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13663536 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.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 3CD5A153BC5 for ; Mon, 13 May 2024 15:31:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614302; cv=none; b=dPBEzKy0Q+xwyuwG0CdNcZD1wHiESV8iFn53qrlSqQlWUfXoWF8hhVNlSoUt8c0mJRLVIwcrHS6tlDrgE23CvlEds3qRJxB3IHSgtyQIqy/BGGtjEvZ1L1DbYtA7IASSn6pT4p+sHmqgGHQIOVffKwTkb8KPrSH/nbrwgc4eY9Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614302; c=relaxed/simple; bh=lnqw1YTHyaD5vTzvWJEUqngsLI3DDxbgjrRrlUhJypM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KlKl3XQDvOcr6VhrCDTyjdbJicYEz3clI8poWr5JwHUB76mNSp9BrooiWrHHTmhXdpL7g1JKQ8WqfjURnHCmiaTWIGxbsIMVW+s6N68g57D4aujEnoN4DLaxO+vgEUudcckX/B8Qktotl43BZYfo4BRhLSopLlD4cWATwP5HCQI= 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=DrUk8JYN; arc=none smtp.client-ip=95.215.58.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="DrUk8JYN" 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=1715614299; 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=LGJqJECahkwNkaZ/cGV67QeDc8nXZjPhmnwOmMDzO3M=; b=DrUk8JYNcWvrAlPWGbKZ5vymd+/ZTLOLrTm+IESf6ZAkLPN8sjXypzROs9T1GaPvu9cZek kT48XheRlnJJSwe86kbdejo7BdYhAMAR6lsT/ZMAEG1y3QB8VLVUy3Cs5znhiSGDlzLzRA Fd7poJ1Duj8us1n0DLskdDHmVok2voA= 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 06/12] drm/bridge: adv7511: Remove a redundant check on existence of bridge->encoder Date: Mon, 13 May 2024 23:31:03 +0800 Message-ID: <20240513153109.46786-7-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: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 checked in the drm_bridge_attach() which happens prior to the adv7511_bridge_attach() get called. Also note that the adv7511_connector_init() is only called by adv7511_bridge_attach(). Hence, it is guaranteed that the .encoder member of the drm_bridge instance is not NULL when adv7511_connector_init() get called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Reviewed-by: Laurent Pinchart 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 dd21b81bd28f..6089b0bb9321 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -877,11 +877,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 From patchwork Mon May 13 15:31:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13663537 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 1EAEC155317 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=1715614305; cv=none; b=M06T/pKKvCmzbH4wGiTtVIkoLAfluhUsFd1HMapkM7EC8KPXkG6dzg8A0aJeAKhQwboAkjwpbE704CJYBHD50m9Zap93Tvhod4WH1d3gOezWTExF6PjIdx63NouoCcDXNat/HDOgkOwVmOrWaHopCkJtKPL55mSbjSDnOPO+wKs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614305; c=relaxed/simple; bh=PgpXnnsEU3a+phmsrJGk4HFEBOrA+xosJkYR3/+m+kw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ehA2cSxuDirrGjDCfx+PPTL8bhu2t59jIpVvMR43j5yz0MpfRUCZY+l0cgC/I7QGwKM0OyfQlKtrRfmu2N+oS0AM6k4HSbmyrW3UN8mcUhKd/LOIrIXuR0n3RmnkHvMV6x+eZ+9nw56Zs9lw1iC/BUIqs6fpXfF/QQFLqoNXvvo= 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="B+TFeV5u" 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: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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, From patchwork Mon May 13 15:31:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13663538 Received: from out-181.mta1.migadu.com (out-181.mta1.migadu.com [95.215.58.181]) (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 B509F155332 for ; Mon, 13 May 2024 15:31:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614309; cv=none; b=Cbx50iJc4wO6AGDhHBGID/7DFUCjc/+HHwFDIdHAZ1wE57caAsrf06wJLsbwDAgU+pJ/cASRubhsBXYU4LSJoH/SSRnTVLvVL9FnQ1K7+Dvw2cjPw1Mx283B6nLAiXNFTOyuXLUYINuBCCHQBaYd1Gsgxfw+Mb8xHlULzmKQy/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614309; c=relaxed/simple; bh=OHFPhmCPsIkBczUTDxHdD/cg+ysEJEKlkbzJo8QYj5Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i5iXfeXMI3H7zk8qiMVDsxoPOofm+16o0V/7RmQJOf7GqI8xp3ARRAhQ0SSgLZ5zLnOAwdySj9bXM6JLHTlOFpaIFzrConjT9R0BQmIk51bT4I7ryUTkZFa6qlQdENxSXTPuHn6R9Bp/QjA/K7UXy5O3q9JggwRcxm+TBDJZqeQ= 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=M1ILIjTF; arc=none smtp.client-ip=95.215.58.181 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="M1ILIjTF" 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=1715614305; 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=nkbxX2OwAWgCxYscfgCjR1gkqrQYqnnGwxp+P1UMWgE=; b=M1ILIjTFecyKk9H38rYtTMjnYDkzCIWH6VjaWO4LgdWGc3drbux8+6gU+rdJ2rFR7Uzrjc pUmJ3PhNBkW+SKNY89iZQQkXrt8kNKzY/vJuIi0AtI2PWN0FsIH3Apj2PdnH4RefOmWadK PrEwXoOIgVOeduT4edcpSk3aWOGA0BQ= 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 08/12] drm/bridge: megachips-stdpxxxx-ge-b850v3-fw: Remove a redundant check on existence of bridge->encoder Date: Mon, 13 May 2024 23:31:05 +0800 Message-ID: <20240513153109.46786-9-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: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT In the ge_b850v3_lvds_create_connector function, the check on the existence of bridge->encoder is not necessary, as it has already been checked in the drm_bridge_attach() function called by upstream bridge or driver. Hence, it is guaranteed that the .encoder member of the drm_bridge instance is not NULL when cdns_mhdp_connector_init() function get called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Reviewed-by: Laurent Pinchart Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c index 4480523244e4..37f1acf5c0f8 100644 --- a/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c +++ b/drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c @@ -165,11 +165,6 @@ static int ge_b850v3_lvds_create_connector(struct drm_bridge *bridge) struct drm_connector *connector = &ge_b850v3_lvds_ptr->connector; int ret; - if (!bridge->encoder) { - DRM_ERROR("Parent encoder object not found"); - return -ENODEV; - } - connector->polled = DRM_CONNECTOR_POLL_HPD; drm_connector_helper_add(connector, From patchwork Mon May 13 15:31:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13663539 Received: from out-171.mta1.migadu.com (out-171.mta1.migadu.com [95.215.58.171]) (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 1412D15535A for ; Mon, 13 May 2024 15:31:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614312; cv=none; b=ORVDLoIx4rDhGr1eUvG3Vb4Y9+uY2i+0Peq8EjJkFdphU4b4KUx4VHXVlNcsomj0c0wHW1T9LP7cXLO8N9E/ZLwrow45VWwHNdjepNMwCSyZDxQQvvSvA97GSNEEtifc9NOP+u/0WnKdzS0JAvLjcqWW4wQGyYPVjBO2GvOtJIw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614312; c=relaxed/simple; bh=NXt/J5Ng7rTdX/rOZFBxwTNCGIqRGOYouh6RODjoTzM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AaZ2F8n6tZhamwqUzGW1KzUllXqIeObg2sn/EvUrWDd0HqQtfzqHPX8VJfoVZS8GPZsyjRD2ddm7zgZMgh5nvPp/ISpQVQnglrhKGtvipJAaD+7jQTHvkMm/5Vk7dobzEV233AE+0ZgiPU9X6T2MXSwGT73byo1vvSF/fPT0tmg= 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=f1Rtkm23; arc=none smtp.client-ip=95.215.58.171 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="f1Rtkm23" 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=1715614309; 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=5sKe1OXm7dCFpe5iXrNPA4j8NtVh7Vk3MKA9L+jmF7U=; b=f1Rtkm23m84bvTk5isa5i8HFrv2NBLfD1VZ4DOeQF3C3SV6nePD4umUszD0aP2H6sc+3DY Q/fMSSzb5w5HkaDhhxdkoRQpHJn/lECZ+Z1fKEzaSe/215tKHgh7ArE5q9jHGfvFwUEvIB blWGtOJVwsv+ZKCIpAczRr7wxmzNHPI= 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 09/12] drm/bridge: synopsys: dw-mipi-dsi: Remove a redundant check on existence of bridge->encoder Date: Mon, 13 May 2024 23:31:06 +0800 Message-ID: <20240513153109.46786-10-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: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 checked in the drm_bridge_attach() function invocked by previous bridge or KMS driver. The previous drm_bridge_attach() will quit with a negative error code returned if it fails for some reasons, 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) { ... }". Reviewed-by: Laurent Pinchart 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; From patchwork Mon May 13 15:31:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13663540 Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) (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 3A759154423 for ; Mon, 13 May 2024 15:31:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614315; cv=none; b=bxLiePC+qfMJKnDCcRwMOOpC0PVpjub1NFyfuMUZp2kue+0tm9HQ3B6nPJxs/B2B1Tsp+2WjwfAZdIbUwjswA8lDsN/P7iolm4ptIlloWm0aK4/FcJZqXs6ISxSefcQwDaprkLdC/oR5Zy4QKClQD8Yxgb23zMzVpxFUy8XdDIg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614315; c=relaxed/simple; bh=79qO2f8ErfI2K2BnvSLXJZrJZYqIjf/h6xk4raeb/zw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I/711qAXrsYvLEAdnt2Xa5xfSgHXRrKEGgnlCJEC/MF/d6MYNb2bLx/lcoKyKkkFEvIpmMY+NZffsK5LowZA/X7mhgLy/mISokHdvZvIGywfsk4rzUC7T8Wf0f1e73+8B7hVNqu+E0BotBz3wDZM/IKoIjEVMvmL9ATNSb6n7vc= 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=HOvXUUet; arc=none smtp.client-ip=95.215.58.176 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="HOvXUUet" 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=1715614312; 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=pFZX1uDvGmBtMyw/S8v8p9QmHUEdeRp0zFB8va4XH2c=; b=HOvXUUetk9gvZRfqTaRI7mpSz5LIpqqijgy22p34EWy4MzsolWIoK8LDSANL5K1+QUxNbU WxjgLY7unARSb+M/NFK+CxDfPIipr9HEBA+dR3N/+dOtJ2ol09Hru+b9jha1/vE1smIfM+ ae5yT0gq5grA08BtC+/fYh5EXmkrlcM= 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 10/12] drm/bridge: lt9611uxc: Remove a redundant check on existence of bridge->encoder Date: Mon, 13 May 2024 23:31:07 +0800 Message-ID: <20240513153109.46786-11-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: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT In the lt9611uxc_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. 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 lt9611uxc_connector_init() function get called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Reviewed-by: Laurent Pinchart Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c index ab702471f3ab..f864c033ba81 100644 --- a/drivers/gpu/drm/bridge/lontium-lt9611uxc.c +++ b/drivers/gpu/drm/bridge/lontium-lt9611uxc.c @@ -337,11 +337,6 @@ static int lt9611uxc_connector_init(struct drm_bridge *bridge, struct lt9611uxc { int ret; - if (!bridge->encoder) { - DRM_ERROR("Parent encoder object not found"); - return -ENODEV; - } - lt9611uxc->connector.polled = DRM_CONNECTOR_POLL_HPD; drm_connector_helper_add(<9611uxc->connector, From patchwork Mon May 13 15:31:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13663541 Received: from out-179.mta1.migadu.com (out-179.mta1.migadu.com [95.215.58.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 6BF0B156245 for ; Mon, 13 May 2024 15:31:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614318; cv=none; b=sMSO9brUm3VDPuTLybAzLDxA5eEQw3eCpdq5x3gbAKdn4gNoS1uHUavQrd+1ha87u55hzF1WueNxqxbbYMPlOe7txuMkWkZm6cCmviQ1AagiQOOOOVkdVpZlknk3K+CN544yF4Q5W2edVN7VJOru/M4AGX1hdGguLclRjz+uGnI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614318; c=relaxed/simple; bh=jAQ3gxGgmSg0OZc8kwMr+0RUUAVho3esOxGSt9gFKzg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Cganxze+fpT5vNbmJUwc08rnMdm3MVvWRvmo9rl3n1cMJYcelmDbTcGezT6kDKeCR5z3RCZpDiAsDGDZSxTD8pM3q8aq1/1OIPYJAsgrN1/4QBkKeJVBS1njrpw0Ub88b3Iy0m6CWZPo9Tpy2/i0hhvYQxw4UlW9Bbm3lKI5OZE= 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=rOpSbqL4; arc=none smtp.client-ip=95.215.58.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="rOpSbqL4" 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=1715614315; 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=DJD65cDkBGq+4KCHhX+gz6i6UVlK6CB2GRuKzloyONE=; b=rOpSbqL4dMh9y8dqICIcFR6YBE2NzkpmEIsI0+MoDxOUpT74bJID04JhgbWWs+NgYL6zaO RU3hOwZmp6gmy9bO1yitBWm+gRJ4Hg8fX7/ltRZD1OiCsevJcoAKX3pKahTvb4jOXE5qjD ZbxzSw93+CXlVuCt9yCJlLC4J6Rg4j4= 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 11/12] drm/bridge: imx: Remove redundant checks on existence of bridge->encoder Date: Mon, 13 May 2024 23:31:08 +0800 Message-ID: <20240513153109.46786-12-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: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT The checks on the existence of bridge->encoder in the implementation of drm_bridge_funcs::attach() is not necessary, as it has already been checked in the drm_bridge_attach() function call by previous bridge or KMS driver. The drm_bridge_attach() will quit with a negative error code returned if it fails for some reasons, hence, it is guaranteed that the .encoder member of the drm_bridge instance is not NULL when various i.MX specific bridge attach functions are called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Reviewed-by: Laurent Pinchart 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); From patchwork Mon May 13 15:31:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sui Jingfeng X-Patchwork-Id: 13663542 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 454A9156863 for ; Mon, 13 May 2024 15:32:00 +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=1715614322; cv=none; b=c4Lu6/ALbpgyC/OJ+g8sew2o+4/ZFFJcJYNT2ku0Hfrzg/oB1xHdq+m9f5rqu8edTmoM/GMOZk0yutqKFsz95K0woNE3c0APHQX7AgmsTojlDF+4d5izM4r56nJlr2lNDhxnqopnxwjx1hZ4fBf08MK59OpZjEDZcSl8Hi/IRHc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715614322; c=relaxed/simple; bh=+RwW506SglCqz4XSZa/oNMNKUKVLp9KPIi06iPs5tuE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XaXSXa/8e2kl4rhU8ovxFXr/Ey95OPGHo57c1f5KXNMatk+4UdnF9DVEDE24OLTzbnyTsoE13086VNedu0FV4pvHo58AdkoTjLRH25PVW1+V0iv6py4Kg+rT/cmE1pvrgkdpsRtVwXfyojMrufKJCPWkKUUCRb+afsvoMiJV3eM= 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=nhcZDRYN; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="nhcZDRYN" 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=1715614318; 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=J5+V1S9388YXGse4Sl78OBq2S/qOMf7C/8WKdb7RqiQ=; b=nhcZDRYN54cD/TsvPcSD91AHbbllmZLhrQztxz4D3HC29SFhukyJHM4ObtTd2TA6d0n4jg 7CTKFvBjuPxckIOdORe8mBHDJFRR8+yjhwa5Fu40wh7QZBnGn60j4aZNoGYDGl1ZPPDXEK 0p1FrwK/5A7PS0MyRv30nx/3Hk8ss0g= 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 12/12] drm/bridge: analogix: Remove redundant checks on existence of bridge->encoder Date: Mon, 13 May 2024 23:31:09 +0800 Message-ID: <20240513153109.46786-13-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: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT The checks on the existence of bridge->encoder in the implementation of drm_bridge_funcs::attach() is not necessary, as it has already been checked in the drm_bridge_attach() function call by previous bridge or KMS driver. The drm_bridge_attach() will quit with a negative error code returned if it fails for some reasons, hence, it is guaranteed that the .encoder member of the drm_bridge instance is not NULL when various bridge attach functions are called. Remove the redundant checking codes "if (!bridge->encoder) { ... }". Reviewed-by: Laurent Pinchart Signed-off-by: Sui Jingfeng --- drivers/gpu/drm/bridge/analogix/analogix-anx6345.c | 5 ----- drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 5 ----- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 5 ----- drivers/gpu/drm/bridge/analogix/anx7625.c | 10 ---------- 4 files changed, 25 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c index c9e35731e6a1..cfe43d2ca3be 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx6345.c @@ -528,11 +528,6 @@ static int anx6345_bridge_attach(struct drm_bridge *bridge, return -EINVAL; } - if (!bridge->encoder) { - DRM_ERROR("Parent encoder object not found"); - return -ENODEV; - } - /* Register aux channel */ anx6345->aux.name = "DP-AUX"; anx6345->aux.dev = &anx6345->client->dev; diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c index 5748a8581af4..58875dde496f 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c @@ -897,11 +897,6 @@ static int anx78xx_bridge_attach(struct drm_bridge *bridge, return -EINVAL; } - if (!bridge->encoder) { - DRM_ERROR("Parent encoder object not found"); - return -ENODEV; - } - /* Register aux channel */ anx78xx->aux.name = "DP-AUX"; anx78xx->aux.dev = &anx78xx->client->dev; diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index df9370e0ff23..7b841232321f 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -1228,11 +1228,6 @@ static int analogix_dp_bridge_attach(struct drm_bridge *bridge, return -EINVAL; } - if (!bridge->encoder) { - DRM_ERROR("Parent encoder object not found"); - return -ENODEV; - } - if (!dp->plat_data->skip_connector) { connector = &dp->connector; connector->polled = DRM_CONNECTOR_POLL_HPD; diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 59e9ad349969..3d09efa4199c 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -2193,11 +2193,6 @@ static int anx7625_bridge_attach(struct drm_bridge *bridge, if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) return -EINVAL; - if (!bridge->encoder) { - DRM_DEV_ERROR(dev, "Parent encoder object not found"); - return -ENODEV; - } - ctx->aux.drm_dev = bridge->dev; err = drm_dp_aux_register(&ctx->aux); if (err) { @@ -2435,11 +2430,6 @@ static void anx7625_bridge_atomic_enable(struct drm_bridge *bridge, dev_dbg(dev, "drm atomic enable\n"); - if (!bridge->encoder) { - dev_err(dev, "Parent encoder object not found"); - return; - } - connector = drm_atomic_get_new_connector_for_encoder(state->base.state, bridge->encoder); if (!connector)