All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v2 2/2] drm: rcar-du: mipi-dsi: Use devm_drm_of_get_bridge helper
Date: Wed, 1 Dec 2021 06:39:53 +0200	[thread overview]
Message-ID: <Yab8mQL7g/thyS00@pendragon.ideasonboard.com> (raw)
In-Reply-To: <163829113971.3059017.15142528562599981704@Monstersaurus>

Hi Kieran,

On Tue, Nov 30, 2021 at 04:52:19PM +0000, Kieran Bingham wrote:
> Quoting Kieran Bingham (2021-11-30 16:25:13)
> > Instead of open coding the calls for
> >   drm_of_find_panel_or_bridge()
> >   devm_drm_panel_bridge_add()
> > 
> > use the devm_drm_of_get_bridge() helper directly.
> > 
> > Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> > ---
> > v2:
> >  - New patch
> > 
> >  drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c | 19 ++++---------------
> >  1 file changed, 4 insertions(+), 15 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c b/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c
> > index 0a9f197ef62c..1dfe20d3d0f2 100644
> > --- a/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c
> > +++ b/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c
> > @@ -637,7 +637,7 @@ static int rcar_mipi_dsi_host_attach(struct mipi_dsi_host *host,
> >                                         struct mipi_dsi_device *device)
> >  {
> >         struct rcar_mipi_dsi *dsi = host_to_rcar_mipi_dsi(host);
> > -       struct drm_panel *panel;
> > +       struct device *dev = dsi->dev;
> >         int ret;
> >  
> >         if (device->lanes > dsi->num_data_lanes)
> > @@ -646,20 +646,9 @@ static int rcar_mipi_dsi_host_attach(struct mipi_dsi_host *host,
> >         dsi->lanes = device->lanes;
> >         dsi->format = device->format;
> >  
> > -       ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 1, 0, &panel,
> > -                                         &dsi->next_bridge);
> > -       if (ret) {
> > -               dev_err_probe(dsi->dev, ret, "could not find next bridge\n");
> > -               return ret;
> > -       }
> > -
> > -       if (!dsi->next_bridge) {
> > -               dsi->next_bridge = devm_drm_panel_bridge_add(dsi->dev, panel);
> > -               if (IS_ERR(dsi->next_bridge)) {
> > -                       dev_err(dsi->dev, "failed to create panel bridge\n");
> > -                       return PTR_ERR(dsi->next_bridge);
> > -               }
> > -       }
> > +       dsi->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0);
> > +       if (IS_ERR(dsi->next_bridge))
> > +               return PTR_ERR(dsi->next_bridge);
> 
> I did make a change here to make this:
> 
> 	dsi->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0);
> 	if (IS_ERR(dsi->next_bridge)) {
> 		dev_err(dev, "failed to get next bridge\n");
> 		return PTR_ERR(dsi->next_bridge);
> 	}
> 
> But it seems I got out of sequence and saved out the wrong patch ;-(
> 
> If you think it's better with the error print, please add it while
> squashing, or if you really need, I can send an updated patch and
> retest.

I think an error message is useful, yes. I'll add it manually.

> >  
> >         /* Initialize the DRM bridge. */
> >         dsi->bridge.funcs = &rcar_mipi_dsi_bridge_ops;

-- 
Regards,

Laurent Pinchart

WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: linux-renesas-soc@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 2/2] drm: rcar-du: mipi-dsi: Use devm_drm_of_get_bridge helper
Date: Wed, 1 Dec 2021 06:39:53 +0200	[thread overview]
Message-ID: <Yab8mQL7g/thyS00@pendragon.ideasonboard.com> (raw)
In-Reply-To: <163829113971.3059017.15142528562599981704@Monstersaurus>

Hi Kieran,

On Tue, Nov 30, 2021 at 04:52:19PM +0000, Kieran Bingham wrote:
> Quoting Kieran Bingham (2021-11-30 16:25:13)
> > Instead of open coding the calls for
> >   drm_of_find_panel_or_bridge()
> >   devm_drm_panel_bridge_add()
> > 
> > use the devm_drm_of_get_bridge() helper directly.
> > 
> > Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> > ---
> > v2:
> >  - New patch
> > 
> >  drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c | 19 ++++---------------
> >  1 file changed, 4 insertions(+), 15 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c b/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c
> > index 0a9f197ef62c..1dfe20d3d0f2 100644
> > --- a/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c
> > +++ b/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c
> > @@ -637,7 +637,7 @@ static int rcar_mipi_dsi_host_attach(struct mipi_dsi_host *host,
> >                                         struct mipi_dsi_device *device)
> >  {
> >         struct rcar_mipi_dsi *dsi = host_to_rcar_mipi_dsi(host);
> > -       struct drm_panel *panel;
> > +       struct device *dev = dsi->dev;
> >         int ret;
> >  
> >         if (device->lanes > dsi->num_data_lanes)
> > @@ -646,20 +646,9 @@ static int rcar_mipi_dsi_host_attach(struct mipi_dsi_host *host,
> >         dsi->lanes = device->lanes;
> >         dsi->format = device->format;
> >  
> > -       ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 1, 0, &panel,
> > -                                         &dsi->next_bridge);
> > -       if (ret) {
> > -               dev_err_probe(dsi->dev, ret, "could not find next bridge\n");
> > -               return ret;
> > -       }
> > -
> > -       if (!dsi->next_bridge) {
> > -               dsi->next_bridge = devm_drm_panel_bridge_add(dsi->dev, panel);
> > -               if (IS_ERR(dsi->next_bridge)) {
> > -                       dev_err(dsi->dev, "failed to create panel bridge\n");
> > -                       return PTR_ERR(dsi->next_bridge);
> > -               }
> > -       }
> > +       dsi->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0);
> > +       if (IS_ERR(dsi->next_bridge))
> > +               return PTR_ERR(dsi->next_bridge);
> 
> I did make a change here to make this:
> 
> 	dsi->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0);
> 	if (IS_ERR(dsi->next_bridge)) {
> 		dev_err(dev, "failed to get next bridge\n");
> 		return PTR_ERR(dsi->next_bridge);
> 	}
> 
> But it seems I got out of sequence and saved out the wrong patch ;-(
> 
> If you think it's better with the error print, please add it while
> squashing, or if you really need, I can send an updated patch and
> retest.

I think an error message is useful, yes. I'll add it manually.

> >  
> >         /* Initialize the DRM bridge. */
> >         dsi->bridge.funcs = &rcar_mipi_dsi_bridge_ops;

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2021-12-01  4:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 16:25 [PATCH v2 0/2] drm: rcar-du: mipi-dsi: Cleanup and Fixes Kieran Bingham
2021-11-30 16:25 ` [PATCH v2 1/2] drm: rcar-du: mipi-dsi: Support bridge probe ordering Kieran Bingham
2021-12-01  4:38   ` Laurent Pinchart
2021-12-01 10:43     ` Kieran Bingham
2021-11-30 16:25 ` [PATCH v2 2/2] drm: rcar-du: mipi-dsi: Use devm_drm_of_get_bridge helper Kieran Bingham
2021-11-30 16:52   ` Kieran Bingham
2021-12-01  4:39     ` Laurent Pinchart [this message]
2021-12-01  4:39       ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yab8mQL7g/thyS00@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.