From nobody Tue Jul 14 12:55:38 2026 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="oiRVoymT" 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: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" To reduce boilerplate, use of_graph_get_remote_node() helper instead of the hand-rolling code. Signed-off-by: Sui Jingfeng Reviewed-by: Dmitry Baryshkov --- 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/br= idge/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) =20 static int dw_hdmi_parse_dt(struct dw_hdmi *hdmi) { - struct device_node *endpoint; struct device_node *remote; =20 if (!hdmi->plat_data->output_port) return 0; =20 - endpoint =3D 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; - } =20 - remote =3D 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 =3D 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; - } =20 hdmi->next_bridge =3D of_drm_find_bridge(remote); of_node_put(remote); --=20 2.34.1