dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 2/3] drm: pl111: Simplify vexpress init
Date: Fri, 17 Apr 2020 12:43:17 -0500	[thread overview]
Message-ID: <CAL_JsqJGZ5jX+-xkVmK5-uJU5hJg3tEa52RanYjY_sF_n+7PsA@mail.gmail.com> (raw)
In-Reply-To: <20200409141603.GB4673@ravnborg.org>

On Thu, Apr 9, 2020 at 9:16 AM Sam Ravnborg <sam@ravnborg.org> wrote:
>
> Hi Rob.
>
> On Wed, Apr 08, 2020 at 07:39:46PM -0600, Rob Herring wrote:
> > The init VExpress variants currently instantiates a 'muxfpga' driver for
> > the sole purpose of getting a regmap for it. There's no reason to
> > instantiate a driver and doing so just complicates things. The muxfpga
> > driver also isn't unregistered properly on module unload. Let's
> > just simplify all this this by just calling
> > devm_regmap_init_vexpress_config() directly.
> >
> > Cc: Eric Anholt <eric@anholt.net>
> > Cc: dri-devel@lists.freedesktop.org
> > Signed-off-by: Rob Herring <robh@kernel.org>
>
> Procastinating, so I took a look at this.
> Nice simplification - on nit below.
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
> > ---
> >  drivers/gpu/drm/pl111/pl111_versatile.c | 21 +++----------
> >  drivers/gpu/drm/pl111/pl111_vexpress.c  | 42 -------------------------
> >  drivers/gpu/drm/pl111/pl111_vexpress.h  |  7 -----
> >  3 files changed, 4 insertions(+), 66 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/pl111/pl111_versatile.c b/drivers/gpu/drm/pl111/pl111_versatile.c
> > index 09aeaffb7660..8c2551088f26 100644
> > --- a/drivers/gpu/drm/pl111/pl111_versatile.c
> > +++ b/drivers/gpu/drm/pl111/pl111_versatile.c
> > @@ -8,6 +8,7 @@
> >  #include <linux/of.h>
> >  #include <linux/of_platform.h>
> >  #include <linux/regmap.h>
> > +#include <linux/vexpress.h>
> >
> >  #include "pl111_versatile.h"
> >  #include "pl111_vexpress.h"
> > @@ -325,17 +326,8 @@ int pl111_versatile_init(struct device *dev, struct pl111_drm_dev_private *priv)
> >       versatile_clcd_type = (enum versatile_clcd)clcd_id->data;
> >
> >       /* Versatile Express special handling */
> > -     if (versatile_clcd_type == VEXPRESS_CLCD_V2M) {
> > +     if (IS_ENABLED(CONFIG_VEXPRESS_CONFIG) && versatile_clcd_type == VEXPRESS_CLCD_V2M) {
> >               struct platform_device *pdev;
> > -
> > -             /* Registers a driver for the muxfpga */
> > -             ret = vexpress_muxfpga_init();
> > -             if (ret) {
> > -                     dev_err(dev, "unable to initialize muxfpga driver\n");
> > -                     of_node_put(np);
> > -                     return ret;
> > -             }
> > -
> >               /* Call into deep Vexpress configuration API */
> >               pdev = of_find_device_by_node(np);
> >               if (!pdev) {
> > @@ -343,13 +335,8 @@ int pl111_versatile_init(struct device *dev, struct pl111_drm_dev_private *priv)
> >                       of_node_put(np);
> >                       return -EPROBE_DEFER;
> >               }
> > -             map = dev_get_drvdata(&pdev->dev);
> > -             if (!map) {
> > -                     dev_err(dev, "sysreg has not yet probed\n");
> > -                     platform_device_put(pdev);
> > -                     of_node_put(np);
> > -                     return -EPROBE_DEFER;
> > -             }
> > +             map = devm_regmap_init_vexpress_config(&pdev->dev);
> > +             platform_device_put(pdev);
> >       } else {
> >               map = syscon_node_to_regmap(np);
> >       }
>
> On the following line there is:
>         if (IS_ERR(map)) {
>                 dev_err(dev, "no Versatile syscon regmap\n");
>                 return PTR_ERR(map);
>         }
>
> The error message no longer tell if this was
> devm_regmap_init_vexpress_config() or syscon_node_to_regmap() that
> caused the error.

Hopefully you'd know what platform you are on.

In any case, it's changed after patch 3.

Rob
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-04-17 17:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200409013947.12667-1-robh@kernel.org>
2020-04-09  1:39 ` [PATCH 1/3] drm: pl111: Fix module autoloading Rob Herring
2020-04-09 14:12   ` Sam Ravnborg
2020-04-17 20:09   ` Linus Walleij
2020-04-09  1:39 ` [PATCH 2/3] drm: pl111: Simplify vexpress init Rob Herring
2020-04-09 14:16   ` Sam Ravnborg
2020-04-17 17:43     ` Rob Herring [this message]
2020-04-17 20:23   ` Linus Walleij
2020-04-09  1:39 ` [PATCH 3/3] drm: pl111: Move VExpress setup into versatile init Rob Herring
2020-04-09 14:34   ` Sam Ravnborg
2020-04-17 17:33     ` Rob Herring
2020-04-17 20:27   ` Linus Walleij
2020-04-19 17:12     ` Rob Herring

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=CAL_JsqJGZ5jX+-xkVmK5-uJU5hJg3tEa52RanYjY_sF_n+7PsA@mail.gmail.com \
    --to=robh@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=sam@ravnborg.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).