[PATCH 2/3] drm: pl111: Simplify vexpress init
Linus Walleij
linus.walleij at linaro.org
Fri Apr 17 20:23:25 UTC 2020
On Thu, Apr 9, 2020 at 3:39 AM Rob Herring <robh at kernel.org> 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 at anholt.net>
> Cc: dri-devel at lists.freedesktop.org
> Signed-off-by: Rob Herring <robh at kernel.org>
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 at linaro.org>
Yours,
Linus Walleij
More information about the dri-devel
mailing list