public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: rcar-du: switch to devm_drm_of_get_bridge
@ 2022-02-21  7:37 José Expósito
  2022-02-21  8:56 ` Maxime Ripard
  0 siblings, 1 reply; 4+ messages in thread
From: José Expósito @ 2022-02-21  7:37 UTC (permalink / raw)
  To: laurent.pinchart
  Cc: kieran.bingham+renesas, airlied, daniel, maxime, dri-devel,
	linux-renesas-soc, linux-kernel, José Expósito

The function "drm_of_find_panel_or_bridge" has been deprecated in
favor of "devm_drm_of_get_bridge".

Switch to the new function and reduce boilerplate.

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
---
 drivers/gpu/drm/rcar-du/rcar_lvds.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
index 72a272cfc11e..99b0febc56d1 100644
--- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
+++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
@@ -712,18 +712,12 @@ static int rcar_lvds_parse_dt(struct rcar_lvds *lvds)
 {
 	int ret;
 
-	ret = drm_of_find_panel_or_bridge(lvds->dev->of_node, 1, 0,
-					  &lvds->panel, &lvds->next_bridge);
-	if (ret)
+	lvds->next_bridge = devm_drm_of_get_bridge(lvds->dev,
+						   lvds->dev->of_node,
+						   1, 0);
+	if (IS_ERR(lvds->next_bridge)) {
+		ret = -EINVAL;
 		goto done;
-
-	if (lvds->panel) {
-		lvds->next_bridge = devm_drm_panel_bridge_add(lvds->dev,
-							      lvds->panel);
-		if (IS_ERR_OR_NULL(lvds->next_bridge)) {
-			ret = -EINVAL;
-			goto done;
-		}
 	}
 
 	if (lvds->info->quirks & RCAR_LVDS_QUIRK_DUAL_LINK)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm: rcar-du: switch to devm_drm_of_get_bridge
  2022-02-21  7:37 [PATCH] drm: rcar-du: switch to devm_drm_of_get_bridge José Expósito
@ 2022-02-21  8:56 ` Maxime Ripard
  2022-02-21 12:15   ` Laurent Pinchart
  0 siblings, 1 reply; 4+ messages in thread
From: Maxime Ripard @ 2022-02-21  8:56 UTC (permalink / raw)
  To: José Expósito
  Cc: laurent.pinchart, kieran.bingham+renesas, airlied, daniel,
	dri-devel, linux-renesas-soc, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 940 bytes --]

On Mon, Feb 21, 2022 at 08:37:57AM +0100, José Expósito wrote:
> The function "drm_of_find_panel_or_bridge" has been deprecated in
> favor of "devm_drm_of_get_bridge".
> 
> Switch to the new function and reduce boilerplate.
> 
> Signed-off-by: José Expósito <jose.exposito89@gmail.com>
> ---
>  drivers/gpu/drm/rcar-du/rcar_lvds.c | 16 +++++-----------
>  1 file changed, 5 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> index 72a272cfc11e..99b0febc56d1 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> @@ -712,18 +712,12 @@ static int rcar_lvds_parse_dt(struct rcar_lvds *lvds)
>  {
>  	int ret;
>  
> -	ret = drm_of_find_panel_or_bridge(lvds->dev->of_node, 1, 0,
> -					  &lvds->panel, &lvds->next_bridge);

I guess lvds->panel can be removed from the rcar_lvds struct as well?

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm: rcar-du: switch to devm_drm_of_get_bridge
  2022-02-21  8:56 ` Maxime Ripard
@ 2022-02-21 12:15   ` Laurent Pinchart
  2022-02-28 18:04     ` José Expósito
  0 siblings, 1 reply; 4+ messages in thread
From: Laurent Pinchart @ 2022-02-21 12:15 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: José Expósito, kieran.bingham+renesas, airlied, daniel,
	dri-devel, linux-renesas-soc, linux-kernel

On Mon, Feb 21, 2022 at 09:56:19AM +0100, Maxime Ripard wrote:
> On Mon, Feb 21, 2022 at 08:37:57AM +0100, José Expósito wrote:
> > The function "drm_of_find_panel_or_bridge" has been deprecated in
> > favor of "devm_drm_of_get_bridge".
> > 
> > Switch to the new function and reduce boilerplate.
> > 
> > Signed-off-by: José Expósito <jose.exposito89@gmail.com>
> > ---
> >  drivers/gpu/drm/rcar-du/rcar_lvds.c | 16 +++++-----------
> >  1 file changed, 5 insertions(+), 11 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> > index 72a272cfc11e..99b0febc56d1 100644
> > --- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
> > +++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
> > @@ -712,18 +712,12 @@ static int rcar_lvds_parse_dt(struct rcar_lvds *lvds)
> >  {
> >  	int ret;
> >  
> > -	ret = drm_of_find_panel_or_bridge(lvds->dev->of_node, 1, 0,
> > -					  &lvds->panel, &lvds->next_bridge);
> 
> I guess lvds->panel can be removed from the rcar_lvds struct as well?

It's used in rcar_lvds_get_lvds_mode() though, so this patch introduces
a regression.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm: rcar-du: switch to devm_drm_of_get_bridge
  2022-02-21 12:15   ` Laurent Pinchart
@ 2022-02-28 18:04     ` José Expósito
  0 siblings, 0 replies; 4+ messages in thread
From: José Expósito @ 2022-02-28 18:04 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Maxime Ripard, kieran.bingham+renesas, airlied, daniel, dri-devel,
	linux-renesas-soc, linux-kernel

On Mon, Feb 21, 2022 at 02:15:01PM +0200, Laurent Pinchart wrote:
> On Mon, Feb 21, 2022 at 09:56:19AM +0100, Maxime Ripard wrote:
> > I guess lvds->panel can be removed from the rcar_lvds struct as well?
> 
> It's used in rcar_lvds_get_lvds_mode() though, so this patch introduces
> a regression.

True, my bad. Sorry about that.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-28 18:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-21  7:37 [PATCH] drm: rcar-du: switch to devm_drm_of_get_bridge José Expósito
2022-02-21  8:56 ` Maxime Ripard
2022-02-21 12:15   ` Laurent Pinchart
2022-02-28 18:04     ` José Expósito

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox