Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp326200lqt; Mon, 18 Mar 2024 08:54:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXzxEn4BIM2ZhF45dSPmXlIaZMpEz+TaxLHygUqdEn2vtfbZ8XvrtnYUqCrR+quzyIoFhl94TW2C4gbgXyemBkcV9ZnBzWxEJne/f7o3w== X-Google-Smtp-Source: AGHT+IH3yUheyjhy9TO/qjCs99R5P1o8CjCVMVFOQd4f6wh+ZqfMcX/uc29WxZTzoWOVecDlCedJ X-Received: by 2002:a17:902:d68b:b0:1de:f91:3cf3 with SMTP id v11-20020a170902d68b00b001de0f913cf3mr10330426ply.55.1710777262322; Mon, 18 Mar 2024 08:54:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710777262; cv=pass; d=google.com; s=arc-20160816; b=xgIzMtEykz5PdXy318TVaT2AQfz+CzzBGHvOnuNml//+2gAD0LSdZUEkBbxUeIoXTz e3WWf1Kw6tI3QuXgmba28/mwpoAQNxG7hhKq5ajEJfaz22tcvLKUBwz/YknhEX/L7CmT S47hclP59W21xXMUnU54Yq+hghwF8Ki20hOtPohszVgg9q45hK4L3rzCed9+PIhpeuNh 6Rcw73YFhkbWxntCqAHugeSww3gD+jgzQl0qbutyCpxccRy+qHQyEJvIozrj56Bc0DIT oJhc4gm2VQOwUrjqtr9zwiz0imwRSQToxtEf0Z/yNVbylTE96EDoR/e6KMDiJ8bWuZ97 jk9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature:message-id; bh=u2fhW2XsomTNdCpefo2Y8uVowFyGOPa7DoCroUYHuXk=; fh=1Ie9FL1mTdstKWGTFjXd8Y/pw20MNdoBUlK2aB0SXt0=; b=FVpXoWAAZoEql7r3CApnqaeI1pPHZG6xA3kRzgtUv5ib3FTuT6e7oQv4tFofkAtAkz o+iKm0OtVBgfF9Y9H4j+lf73NmJtZbGAOu67TVCIYYlMCWf1zyTX8mo9MzE3B9dVvayy vLs73c/zKolzrlQ7bVm6vJE9sf70dwFJKMdCWlp9CQLgJMvwrbeb4qZ0/t/hgZ8bKB4w 7s83pdY1aqR6urUwORD8f82q0JscJnZ8RJpvt72J2p1CDarfltdb+2F5EEO0AOu3byqw caR+XnVe4ZXOHYGuoNqQzo+A24UspSBYUyOEROnunCo1bueOU7lnTQo2qRiyUJOBbQYe VxAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=gwRvodGd; 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-106339-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106339-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id w16-20020a170902e89000b001e027e544absi2130016plg.131.2024.03.18.08.54.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 08:54:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-106339-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=gwRvodGd; 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-106339-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106339-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 2F0E1B21DFC for ; Mon, 18 Mar 2024 15:53:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2128152F86; Mon, 18 Mar 2024 15:53:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="gwRvodGd" 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 4403252F6D for ; Mon, 18 Mar 2024 15:53:25 +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=1710777207; cv=none; b=Bq9YQeg+odfy5j7VOWt2zqy2GwN+42wvWVYuJ5XsFfXbx0A52sxUGuBcbfETV4eglnoWZRU51i/TYQd8NWRaW+kotHpkba/Jtp1Kz4T/W4d/HhOTW/aWhSM7LLq/LPHQd0cyoDvCESCSRd2yht2B2qFqGH9Fm0S9DcCJforzjPQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710777207; c=relaxed/simple; bh=z0wJ+k9rqzFqZleSpK4pYoTZqFsI54pQOlfGa1XA+Hg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WWylkO0egbQQZdvvyMDNi5w/c+9plIMiUgzB57Cq+xFkydiJ+RdE7lBKJF+MYw/6PiJFQ4qlHUCCZucK/VQ4/zGpx7EWjLkbicn8xhNLjqqYcpczmHS1xOu0JyjKnxXGEMpM4umlw+mnp53qCuCqFWTRiXddRL/GpVSymxBLvGA= 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=gwRvodGd; 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 Message-ID: <22229306-aa72-4367-b029-fbdff4410cec@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1710777203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u2fhW2XsomTNdCpefo2Y8uVowFyGOPa7DoCroUYHuXk=; b=gwRvodGdcbILQ+b8YI+F3em9ZFo2G15b7eb75ycddqP88fLN0j4PuBzDMVddeCxSFlOgBX 59nwzRSYzIUUUXINo27wZ4D6Fklty9A/hp9VIh3/zpz9Q8x5BQ54iBnLb7QBB5rYlH1uV7 SReV9oeTK+U/JfWA8bBdR+cVOi/RL0Y= Date: Mon, 18 Mar 2024 23:53:11 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH] drm: bridge: thc63lvd1024: Switch to use of_graph_get_remote_node() Content-Language: en-US To: Laurent Pinchart Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20240316172800.1168390-1-sui.jingfeng@linux.dev> <20240318153326.GD13682@pendragon.ideasonboard.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sui Jingfeng In-Reply-To: <20240318153326.GD13682@pendragon.ideasonboard.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Hi, On 2024/3/18 23:33, Laurent Pinchart wrote: > Hi Sui, > > Thank you for the patch. > > On Sun, Mar 17, 2024 at 01:28:00AM +0800, Sui Jingfeng wrote: >> To reduce boilerplate, use of_graph_get_remote_node() helper instead of >> the hand-rolling code. >> >> Signed-off-by: Sui Jingfeng >> --- >> drivers/gpu/drm/bridge/thc63lvd1024.c | 24 +++--------------------- >> 1 file changed, 3 insertions(+), 21 deletions(-) >> >> diff --git a/drivers/gpu/drm/bridge/thc63lvd1024.c b/drivers/gpu/drm/bridge/thc63lvd1024.c >> index d4c1a601bbb5..5f99f9724081 100644 >> --- a/drivers/gpu/drm/bridge/thc63lvd1024.c >> +++ b/drivers/gpu/drm/bridge/thc63lvd1024.c >> @@ -123,28 +123,10 @@ static int thc63_parse_dt(struct thc63_dev *thc63) >> struct device_node *endpoint; >> struct device_node *remote; >> >> - endpoint = of_graph_get_endpoint_by_regs(thc63->dev->of_node, >> - THC63_RGB_OUT0, -1); >> - if (!endpoint) { >> - dev_err(thc63->dev, "Missing endpoint in port@%u\n", >> - THC63_RGB_OUT0); >> - return -ENODEV; >> - } >> - >> - remote = of_graph_get_remote_port_parent(endpoint); >> - of_node_put(endpoint); >> - if (!remote) { >> - dev_err(thc63->dev, "Endpoint in port@%u unconnected\n", >> - THC63_RGB_OUT0); >> + remote = of_graph_get_remote_node(thc63->dev->of_node, >> + THC63_RGB_OUT0, -1); >> + if (!remote) > The old logic is equivalent to of_graph_get_remote_node(), but now the > driver will fail probing without an error message. That's not very nice > as it leads to difficult to debug problems. I would keep one dev_err() > here: > > dev_err(thc63->dev, "No remote endpoint for port@%u\n", > THC63_RGB_OUT0); > > As your patch has been merged already, would you like to post a > follow-up patch to fix this ? Yes, this is indeed a difference. I will post a follow-up patch to fix this. >> return -ENODEV; >> - } >> - >> - if (!of_device_is_available(remote)) { >> - dev_err(thc63->dev, "port@%u remote endpoint is disabled\n", >> - THC63_RGB_OUT0); >> - of_node_put(remote); >> - return -ENODEV; >> - } >> >> thc63->next = of_drm_find_bridge(remote); >> of_node_put(remote); -- Best regards, Sui