Received: by 2002:ab2:6486:0:b0:1ef:eae8:a797 with SMTP id de6csp435526lqb; Sat, 16 Mar 2024 10:05:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXAuXUMCtb5J1lOAxkiopkJ9qUfMbHLO83qdvW63xip6KVU/b5SUEEzyHCxRF9Afv6XYk5caSfzfhc/xwZbGjUxHk/WPy/HFIvDoOH9/w== X-Google-Smtp-Source: AGHT+IE/a8gMHcOn/CEVLLt2vOTgVNkwKLDb70NUT4ETA8UaNJYvfP5EovFXBprRQsuboO2VN5jW X-Received: by 2002:a05:6808:1490:b0:3c3:595a:e561 with SMTP id e16-20020a056808149000b003c3595ae561mr8679865oiw.10.1710608749343; Sat, 16 Mar 2024 10:05:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710608749; cv=pass; d=google.com; s=arc-20160816; b=f3x2ORoe7CCfLusxTHHd3Rfnfl7sY93kTX5vyZD3hiupMoUpwZ6xBW6v5vNqjHxslY 7XIMjgShy+jg7W+K0lVvJrUZJl65QmJN5vypFqCEsWXW/SiUlVdTb0MK/vX5x2eP8WOU dJz/6D41RhghPF3KylYkdSrZEmcvBavgkUxZ7jGUD/BOuCdTq40ObDnUVZbY7bNogJrJ 4MOyz7TwwqjaHIcvcMMf3+WQLaltbPSqDvw2CsT0DvkIME8pPQnHMht8c125r1EcO7Fj G6yTk8EzDCA5sVjBAQJ4qs0OoaD5Wr99XZcfXjZgHylkNwF6JtWc+aFYwNcHqdYKTtT/ EsQA== 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=zL4myksVicIour6XUMzWlw8VhqJACYKy3DZPBN3+yT8=; fh=xqoRSO6sHci+aSawGXMHfLDqkiwLzQCMwK0XjBq+ACQ=; b=Hcn5jxOLgAM7NrzP6y/gHb/Jh/ni0DTwjCocgqbf7RiRaluiGyJbLT/MbyWBm3JzM4 edaSqXVN/gIRx5HDO1/1Oh86RCR2mqyJt+MJxkOpfmWUw4546ruldWyGIouA94gWYIMO f+srMBHAHAEugsbmdOUq1OuQMxalEj1JbeHbGBerEATvKX21drX05A/j6ueTd5GemJwP FZCnj7LZRfruCYnBv7L5BWH8eocKxiQCdTu6HmqfROrG5DeiV+euHfjjnbN+jgoDuA0x 1m+mNAmZV+SxGbTDaEoxnEs6rd2WI27L6grqRhYWYO/UY9kxIJUy3PJDmLJ/Iv7pGFxM mTOg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=oiRVoymT; 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-105239-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105239-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p11-20020ad45f4b000000b00690cca36e5bsi5294354qvg.360.2024.03.16.10.05.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Mar 2024 10:05:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105239-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=oiRVoymT; 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-105239-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105239-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0CF8D1C20D2A for ; Sat, 16 Mar 2024 17:05:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D350C1BDCE; Sat, 16 Mar 2024 17:05:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="oiRVoymT" Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.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 9A4CD1BC41 for ; Sat, 16 Mar 2024 17:05:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710608742; cv=none; b=BkqoipURATdZiNOJwL6JXEcwaVlWaiXKx7/z8Xl2kj4vqX18sDeAzjhOHrJ4l6N8dAEl8djd9/lNJDhwgeuzZ68A6WyJgFeQd00RE1OXrYyR1vMKHVHXZNypVeaLUcvNSLDluc45rEYkteQWaqqn0MShq0T8OWhaDNOYOmzzxII= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710608742; c=relaxed/simple; bh=DQRBaBsKmt6Xv5cMCll9mcDgeA1I1nTM7iEy+iYKZ6c=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=HMKcDL8fOQhtnZd68DH92kEJzzRIAma9BUFHhkfGCro23orDydPlkTO8c6y7bA8w+Pg+Mlh3nDzlHWyUGSwR/CYE/B9s4PwunsTKRYC4HoI4wXH5toyWTIioMA9bTauflVDux6nFg9AChdjXnitwNHeH/b2Oxj98BlssG+E+AQ0= 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=oiRVoymT; arc=none smtp.client-ip=91.218.175.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 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=1710608738; 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=zL4myksVicIour6XUMzWlw8VhqJACYKy3DZPBN3+yT8=; b=oiRVoymTTXBAKlQAorVIVE6dkSEUWzfJJuFLJJkodKHUmpixANv/zxf/QbaufNMN8OCAkz sYqmD7PazJLMUOalwXCJwT+fMIbl1XnQBGnkKkolkrYNwWRmeKcFPNYQBVIH1ur2L2vLqf aPCs8ybVKSp79Nvu79iqVoynEG6lNiM= From: Sui Jingfeng To: Andrzej Hajda Cc: Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jani Nikula , Heiner Kallweit , Azeem Shaikh , Sandor Yu , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Sui Jingfeng Subject: [PATCH] drm: bridge: dw_hdmi: Switch to of_graph_get_remote_node() Date: Sun, 17 Mar 2024 01:05:13 +0800 Message-Id: <20240316170513.1159724-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 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/synopsys/dw-hdmi.c | 31 +++-------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index cceb5aab6c83..9f2bc932c371 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -3291,40 +3291,17 @@ static void dw_hdmi_init_hw(struct dw_hdmi *hdmi) static int dw_hdmi_parse_dt(struct dw_hdmi *hdmi) { - struct device_node *endpoint; struct device_node *remote; if (!hdmi->plat_data->output_port) return 0; - endpoint = of_graph_get_endpoint_by_regs(hdmi->dev->of_node, - hdmi->plat_data->output_port, - -1); - if (!endpoint) { - /* - * On platforms whose bindings don't make the output port - * mandatory (such as Rockchip) the plat_data->output_port - * field isn't set, so it's safe to make this a fatal error. - */ - dev_err(hdmi->dev, "Missing endpoint in port@%u\n", - hdmi->plat_data->output_port); - return -ENODEV; - } - remote = of_graph_get_remote_port_parent(endpoint); - of_node_put(endpoint); - if (!remote) { - dev_err(hdmi->dev, "Endpoint in port@%u unconnected\n", - hdmi->plat_data->output_port); + remote = of_graph_get_remote_node(hdmi->dev->of_node, + hdmi->plat_data->output_port, + -1); + if (!remote) return -ENODEV; - } - - if (!of_device_is_available(remote)) { - dev_err(hdmi->dev, "port@%u remote device is disabled\n", - hdmi->plat_data->output_port); - of_node_put(remote); - return -ENODEV; - } hdmi->next_bridge = of_drm_find_bridge(remote); of_node_put(remote); -- 2.34.1