Re: [PATCH 2/3] drm: pl111: Simplify vexpress init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 9, 2020 at 3:39 AM Rob Herring <robh@xxxxxxxxxx> 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@xxxxxxxxxx>
> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Rob Herring <robh@xxxxxxxxxx>

OK... looking at this.

> +       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);

So this finds the platform device for compatible  "arm,vexpress-muxfpga",
ha!

> +               map = devm_regmap_init_vexpress_config(&pdev->dev);
> +               platform_device_put(pdev);

So then you can just do it like that.

Clever! Hats off for digging through my (unnecessary complex) code.

Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux