From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (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 C7D0B4A3E; Tue, 6 Feb 2024 16:44:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707237873; cv=none; b=kxT6shNlYuWGEFjvqQvFIIr/v+BT0Ou3lWnBmtDXzZ9QGIXjDozGK1o7T2rsvNxvjS2r6EgdtAb+/Lz1uk7ff/J/pGTJ5MQSCE2Frn6cRel0yMdrinkUKAwRhy3MuoKrgUf2tH1TqX+2+MB3Pz1T0JU1L/AVQaulEYKNB0z1CxA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707237873; c=relaxed/simple; bh=K6G7EqF6aigFxEzvt49ggiwTXwmHFHPviNYyVpcqf74=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oZsZF4DIqkygqo5VqnKKjp4t8jTxs92dxo1v/hSzA1S8tV/HFV/yYAtVuXjwkJYpkNm5N1lG06TIY5RSqapzSGFLvyGNXG8rqHghjA6k0KjLGrDVqgMFKHtJsc8w1uMlJFhgcHyVsquADxUm/yyuxtiuPCfGSseTbGU3US7EI1o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=cw1+savb; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="cw1+savb" Received: from pendragon.ideasonboard.com (117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id AC30C74A; Tue, 6 Feb 2024 17:43:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1707237785; bh=K6G7EqF6aigFxEzvt49ggiwTXwmHFHPviNYyVpcqf74=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cw1+savbvw/X4hlFF49bIw9MtlsD9RU5N4r4Oq3JDohk83TQVv/CsvPp/lJ8RCyrR TYKlOwlWfdqjs8IbmUDw2IwG0uliy504d51XqHGImWfnERiyRyvGA9Qy+ASaUlNk6R hV5XbBSmp5c2qqNeoHRAUihJllk0Cntj6i3/w1W8= Date: Tue, 6 Feb 2024 18:44:29 +0200 From: Laurent Pinchart To: Kuninori Morimoto Cc: "Lad, Prabhakar" , =?utf-8?Q?=22Uwe_Kleine-K=C3=B6nig=22?= , Alexandre Belloni , Alexandre Torgue , Alexey Brodkin , Alim Akhtar , Andrzej Hajda , Biju Das , Broadcom internal kernel review list , Claudiu Beznea , Daniel Vetter , Dave Stevenson , David Airlie , Eugen Hristev , Florian Fainelli , Hans Verkuil , Helge Deller , Hugues Fruchet , Jacopo Mondi , Jessica Zhang , Krzysztof Kozlowski , Maarten Lankhorst , Mauro Carvalho Chehab , Maxime Coquelin , Maxime Ripard , Neil Armstrong , Nicolas Ferre , Russell King , Sakari Ailus , Sam Ravnborg , Sylwester Nawrocki , Thomas Zimmermann , Tim Harvey , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: Re: [PATCH 4/4] video: fbdev: replace of_graph_get_next_endpoint() Message-ID: <20240206164429.GD2827@pendragon.ideasonboard.com> References: <87ttmmnvzh.wl-kuninori.morimoto.gx@renesas.com> <87o7cunvwv.wl-kuninori.morimoto.gx@renesas.com> Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87o7cunvwv.wl-kuninori.morimoto.gx@renesas.com> Hi Morimoto-san, Thank you for the patch. On Tue, Feb 06, 2024 at 02:55:45AM +0000, Kuninori Morimoto wrote: > From DT point of view, in general, drivers should be asking for a > specific port number because their function is fixed in the binding. > > of_graph_get_next_endpoint() doesn't match to this concept. > > Simply replace > > - of_graph_get_next_endpoint(xxx, NULL); > + of_graph_get_endpoint_by_regs(xxx, 0, -1); > > Link: https://lore.kernel.org/r/20240202174941.GA310089-robh@kernel.org > Signed-off-by: Kuninori Morimoto > --- > drivers/video/fbdev/amba-clcd.c | 2 +- > drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 3 ++- > drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 20 +------------------ > drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 3 ++- > drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c | 3 ++- > drivers/video/fbdev/omap2/omapfb/dss/venc.c | 3 ++- > drivers/video/fbdev/pxafb.c | 2 +- > include/video/omapfb_dss.h | 3 --- > 8 files changed, 11 insertions(+), 28 deletions(-) > > diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c > index 0399db369e70..2371b204cfd2 100644 > --- a/drivers/video/fbdev/amba-clcd.c > +++ b/drivers/video/fbdev/amba-clcd.c This driver has been deleted in v6.8-rc1. > @@ -691,7 +691,7 @@ static int clcdfb_of_init_display(struct clcd_fb *fb) > /* > * Fetch the panel endpoint. > */ > - endpoint = of_graph_get_next_endpoint(fb->dev->dev.of_node, NULL); > + endpoint = of_graph_get_endpoint_by_regs(fb->dev->dev.of_node, 0, -1); > if (!endpoint) > return -ENODEV; > > diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c > index b7eb17a16ec4..1f13bcf73da5 100644 > --- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c > +++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c > @@ -28,6 +28,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -5079,7 +5080,7 @@ static int dsi_probe_of(struct platform_device *pdev) > struct device_node *ep; > struct omap_dsi_pin_config pin_cfg; > > - ep = omapdss_of_get_first_endpoint(node); > + ep = of_graph_get_endpoint_by_regs(node, 0, -1); > if (!ep) > return 0; > > diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c > index 0282d4eef139..14965a3fd05b 100644 > --- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c > +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c > @@ -130,24 +130,6 @@ static struct device_node *omapdss_of_get_remote_port(const struct device_node * > return np; > } > > -struct device_node * > -omapdss_of_get_first_endpoint(const struct device_node *parent) > -{ > - struct device_node *port, *ep; > - > - port = omapdss_of_get_next_port(parent, NULL); > - > - if (!port) > - return NULL; > - > - ep = omapdss_of_get_next_endpoint(port, NULL); > - > - of_node_put(port); > - > - return ep; > -} > -EXPORT_SYMBOL_GPL(omapdss_of_get_first_endpoint); > - I *think* replacing omapdss_of_get_first_endpoint() with of_graph_get_endpoint_by_regs(0, -1) is functionally equivalent in all cases, but a confirmation from Tomi would be nice. I wonder if it wouldn't be time to drop the fbdev driver though... Reviewed-by: Laurent Pinchart > struct omap_dss_device * > omapdss_of_find_source_for_first_ep(struct device_node *node) > { > @@ -155,7 +137,7 @@ omapdss_of_find_source_for_first_ep(struct device_node *node) > struct device_node *src_port; > struct omap_dss_device *src; > > - ep = omapdss_of_get_first_endpoint(node); > + ep = of_graph_get_endpoint_by_regs(node, 0, -1); > if (!ep) > return ERR_PTR(-EINVAL); > > diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c > index f05b4e35a842..8f407ec134dc 100644 > --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c > +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c > @@ -20,6 +20,7 @@ > #include > #include > #include > +#include > #include > #include > #include